public class Crypto extends Object
| Constructor and Description |
|---|
Crypto() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(String password,
byte[] payload)
Decrypts data in
BUFFER_SIZE chunks using AES-GCM using a 256-bit Argon2ID key. |
static byte[] |
encrypt(String password,
byte[] data)
Encrypts data in
BUFFER_SIZE chunks using AES-GCM using a 256-bit Argon2ID key. |
public static byte[] encrypt(String password, byte[] data) throws UnsupportedEncodingException, org.bouncycastle.crypto.InvalidCipherTextException
BUFFER_SIZE chunks using AES-GCM using a 256-bit Argon2ID key.
The format returned is compatible with MinIO servers and clients. Header format: salt [string
32] | aead id [byte 1] | nonce [byte 8] | encrypted_data [byte len(encrypted_data)] To see the
original implementation in Go, check out the madmin-go library.password - Plaintext passworddata - The data to encryptUnsupportedEncodingExceptionorg.bouncycastle.crypto.InvalidCipherTextExceptionpublic static byte[] decrypt(String password, byte[] payload) throws UnsupportedEncodingException, org.bouncycastle.crypto.InvalidCipherTextException
BUFFER_SIZE chunks using AES-GCM using a 256-bit Argon2ID key.password - Plaintext passwordpayload - Data to decrypt, including headersUnsupportedEncodingExceptionorg.bouncycastle.crypto.InvalidCipherTextException