Search in sources :

Example 1 with AESLightEngine

use of org.bouncycastle.crypto.engines.AESLightEngine in project openremote by openremote.

the class SecureUtils method encryptWithAES.

public static byte[] encryptWithAES(final byte[] data, final byte[] key) {
    final byte[] encrypted = new byte[data.length];
    final CipherParameters cipherParameters = new KeyParameter(key);
    final AESLightEngine engine = new AESLightEngine();
    engine.init(true, cipherParameters);
    engine.processBlock(data, 0, encrypted, 0);
    return encrypted;
}
Also used : CipherParameters(org.bouncycastle.crypto.CipherParameters) KeyParameter(org.bouncycastle.crypto.params.KeyParameter) AESLightEngine(org.bouncycastle.crypto.engines.AESLightEngine)

Aggregations

CipherParameters (org.bouncycastle.crypto.CipherParameters)1 AESLightEngine (org.bouncycastle.crypto.engines.AESLightEngine)1 KeyParameter (org.bouncycastle.crypto.params.KeyParameter)1