INNER CODE UNIT · Kotlin

publicPrivateKeyEncryptionStep1

terl/lazysodium-java · sample-app/src/main/kotlin/Main.kt:128

    private fun publicPrivateKeyEncryptionStep1() {
        printSection("Running public private key encryption")
        log()
        printStep(
            "1",
            "Generating public private keypairs",
            "In this step we'll generate public keys for Alice " +
                    "and Bob."
        )
        val aliceKp: KeyPair = lazySodium.cryptoBoxKeypair()
        val bobKp: KeyPair = lazySodium.cryptoBoxKeypair()
        log()
        logt("Alice's public key: " + aliceKp.publicKey.asHexString)
        logt("Bob's public key: " + bobKp.publicKey.asHexString)
        log()
        publicPrivateKeyEncryptionStep2(aliceKp, bobKp)
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…