public class Encryption extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Encryption.keyIv |
| Modifier and Type | Field and Description |
|---|---|
static String |
algo |
static String |
algoKey |
static int |
ivLength |
| Constructor and Description |
|---|
Encryption() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decryptData(byte[] dataEnc,
byte[] keyMaterial)
This method decrypts the data using the same encryption-method
as is defined in the header of this class.
|
static byte[] |
decryptData(com.google.protobuf.ByteString dataEnc,
byte[] keyMaterial)
Convenience method for use with googles-protobuf bytestring.
|
static byte[] |
encryptData(byte[] data,
byte[] keyMaterial)
Encrypts the data using the encryption defined in the header.
|
public static String algo
public static String algoKey
public static int ivLength
public static byte[] encryptData(byte[] data,
byte[] keyMaterial)
throws CothorityCryptoException
data - the data to encryptkeyMaterial - random string of length ivLength + keylength.
The first ivLength bytes are taken as iv, the
rest is taken as the symmetric symmetricKey.CothorityCryptoException - if there's a problem with the cryptographypublic static byte[] decryptData(byte[] dataEnc,
byte[] keyMaterial)
throws CothorityCryptoException
dataEnc - the encrypted data from the skipchainkeyMaterial - the decrypted keyMaterialCothorityCryptoException - if there's a problem with the cryptographypublic static byte[] decryptData(com.google.protobuf.ByteString dataEnc,
byte[] keyMaterial)
throws CothorityCryptoException
dataEnc - as google protobuf bytestringkeyMaterial - the decrypted keyMaterialCothorityCryptoException - if there's a problem with the cryptographyCopyright © 2018. All rights reserved.