public class Salsa20StreamEncryptor extends Object implements StreamEncryptor
Salsa20 doesn't quite fit the memory model supposed by SerializableDatabase.StreamEncryptor - all encrypted items have to be en/decrypted in order of encryption, i.e. in document order and at the same time.
The encrypt and decrypt methods actually do the same thing. They are here only to fulfill the interface contract.
StreamEncryptor.None| Constructor and Description |
|---|
Salsa20StreamEncryptor(byte[] key)
Constructor creates engine used for both encryption and decryption
|
| Modifier and Type | Method and Description |
|---|---|
static org.spongycastle.crypto.engines.Salsa20Engine |
createSalsa20(byte[] key)
Creates a Salsa20 engine
|
byte[] |
decrypt(byte[] encryptedText) |
byte[] |
encrypt(byte[] decryptedText) |
byte[] |
getKey() |
public Salsa20StreamEncryptor(byte[] key)
key - the key to usepublic static org.spongycastle.crypto.engines.Salsa20Engine createSalsa20(byte[] key)
key - the key to usepublic byte[] getKey()
getKey in interface StreamEncryptorpublic byte[] decrypt(byte[] encryptedText)
decrypt in interface StreamEncryptorpublic byte[] encrypt(byte[] decryptedText)
encrypt in interface StreamEncryptorCopyright © 2016. All rights reserved.