Class ExampleScenario4

java.lang.Object
co.ankatech.ankasecure.sdk.examples.ExampleScenario4

public final class ExampleScenario4 extends Object

Scenario 4 – Streaming Re-encrypt (RSA-2048 → ML-KEM-1024)

This scenario demonstrates how to migrate classical RSA-encrypted data to a post-quantum ML-KEM-encrypted format without exposing plaintext. All cryptographic operations use the streaming API, meaning the service exchanges a two-part detached JWE (General-JSON header + raw ciphertext stream).

  1. Generate an RSA-2048 key.
  2. Stream-encrypt a file (detached JWE).
  3. Generate an ML-KEM-1024 key.
  4. Re-encrypt the ciphertext on the server (RSA → KEM).
  5. Stream-decrypt with the KEM key.
  6. Validate round-trip integrity.

Temporary artefacts are placed under temp_files/.

Implementation notes (Java 21+):

Thread-safety: this class is stateless and immutable.

Since:
2.1.0
Author:
ANKATech – Security Engineering
  • Method Details

    • main

      public static void main(String[] args)
      Entry-point.
      Parameters:
      args - ignored