-
public interface SecretBox.Lazy
-
-
Method Summary
Modifier and Type Method Description abstract KeycryptoSecretBoxKeygen()Generates a secret symmetric key. abstract StringcryptoSecretBoxEasy(String message, Array<byte> nonce, Key key)Encrypts a message. abstract StringcryptoSecretBoxOpenEasy(String cipher, Array<byte> nonce, Key key)Decrypts a message. abstract DetachedEncryptcryptoSecretBoxDetached(String message, Array<byte> nonce, Key key)Encrypts a message with the mac separately abstract StringcryptoSecretBoxOpenDetached(DetachedEncrypt cipherAndMac, Array<byte> nonce, Key key)Decrypts a message. -
-
Method Detail
-
cryptoSecretBoxKeygen
abstract Key cryptoSecretBoxKeygen()
Generates a secret symmetric key.
-
cryptoSecretBoxEasy
abstract String cryptoSecretBoxEasy(String message, Array<byte> nonce, Key key)
Encrypts a message.
- Parameters:
message- The message to encrypt.nonce- A randomly generated nonce of size NONCEBYTES.key- The key.
-
cryptoSecretBoxOpenEasy
abstract String cryptoSecretBoxOpenEasy(String cipher, Array<byte> nonce, Key key)
Decrypts a message.
- Parameters:
cipher- The hexadecimal cipher text.nonce- The nonce that was used when you encrypted with cryptoSecretBoxEasy.key- The key.
-
cryptoSecretBoxDetached
abstract DetachedEncrypt cryptoSecretBoxDetached(String message, Array<byte> nonce, Key key)
Encrypts a message with the mac separately
- Parameters:
message- The message to encrypt.nonce- A randomly generated nonce of size NONCEBYTES.key- The key.
-
cryptoSecretBoxOpenDetached
abstract String cryptoSecretBoxOpenDetached(DetachedEncrypt cipherAndMac, Array<byte> nonce, Key key)
Decrypts a message.
- Parameters:
cipherAndMac- The hexadecimal cipher text.nonce- The nonce that was used when you encrypted with cryptoSecretBoxEasy.key- The key.
-
-
-
-