INNER CODE UNIT · Kotlin

symmetricKeyEncryptionStep2

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

    private fun symmetricKeyEncryptionStep2(key: Key, nonce: ByteArray, encrypted: String) {
        log()
        printStep(
            "2",
            "Decrypting a message with a symmetric key",
            "We will now decrypt the message we encrypted in the previous step."
        )
        val decrypted: String = lazySodium.cryptoSecretBoxOpenEasy(encrypted, nonce, key)
        log()
        logt("The decrypted string is $decrypted.")
        logt("It should equal the message we encrypted in step 1.")
    }

    @Throws(SodiumException::class)
    private fun publicPrivateKeyEncryptionStep1() {
        printSection("Running public private key encryption")
        log()
        printStep(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…