public static interface SecretBox.Lazy
| Modifier and Type | Method and Description |
|---|---|
DetachedEncrypt |
cryptoSecretBoxDetached(java.lang.String message,
byte[] nonce,
Key key)
Encrypts a message with the mac separately
|
java.lang.String |
cryptoSecretBoxEasy(java.lang.String message,
byte[] nonce,
Key key)
Encrypts a message.
|
Key |
cryptoSecretBoxKeygen()
Generates a secret symmetric key.
|
java.lang.String |
cryptoSecretBoxOpenDetached(DetachedEncrypt cipherAndMac,
byte[] nonce,
Key key)
Decrypts a message.
|
java.lang.String |
cryptoSecretBoxOpenEasy(java.lang.String cipher,
byte[] nonce,
Key key)
Decrypts a message.
|
Key cryptoSecretBoxKeygen()
Helpers.Lazy.sodiumBin2Hex(byte[]).java.lang.String cryptoSecretBoxEasy(java.lang.String message,
byte[] nonce,
Key key)
throws SodiumException
message - The message to encrypt.nonce - A randomly generated nonce of size SecretBox.NONCEBYTES. Use Random.randomBytesBuf(int).key - The key. A hexadecimal string that's been through Helpers.Lazy.sodiumBin2Hex(byte[]).Helpers.Lazy.sodiumBin2Hex(byte[])'ified.SodiumExceptionjava.lang.String cryptoSecretBoxOpenEasy(java.lang.String cipher,
byte[] nonce,
Key key)
throws SodiumException
cipher - The hexadecimal cipher text. See Helpers.Lazy.sodiumBin2Hex(byte[]).nonce - The nonce that was used when you encrypted with cryptoSecretBoxEasy(String, byte[], Key).key - The key. A hexadecimal string that's been through Helpers.Lazy.sodiumBin2Hex(byte[]).SodiumExceptionDetachedEncrypt cryptoSecretBoxDetached(java.lang.String message, byte[] nonce, Key key) throws SodiumException
message - The message to encrypt.nonce - A randomly generated nonce of size SecretBox.NONCEBYTES. Use Random.randomBytesBuf(int).key - The key. A hexadecimal string that's been through Helpers.Lazy.sodiumBin2Hex(byte[]).Helpers.Lazy.sodiumBin2Hex(byte[])'ified.SodiumExceptionjava.lang.String cryptoSecretBoxOpenDetached(DetachedEncrypt cipherAndMac, byte[] nonce, Key key) throws SodiumException
cipherAndMac - The hexadecimal cipher text. See Helpers.Lazy.sodiumBin2Hex(byte[]).nonce - The nonce that was used when you encrypted with cryptoSecretBoxEasy(String, byte[], Key).key - The key. A hexadecimal string that's been through Helpers.Lazy.sodiumBin2Hex(byte[]).SodiumException