botanj
1.0.0
Botanj เป็น Java Security Provider (JSP) ซึ่งใช้ Botan เพื่อดำเนินการส่วนหนึ่งของส่วนขยายการเข้ารหัสจาวา (JCE) การใช้งานนี้เข้ากันได้กับ JSP อื่น ๆ (เช่นปราสาทเด้ง) ซึ่งทำให้การย้ายถิ่นอย่างราบรื่น
Botanj ใช้ JNR-FFI สำหรับการโหลดรหัสดั้งเดิมของพฤกษศาสตร์
mvn test final MessageDigest digest = MessageDigest . getInstance ( "blake2b-512" , BotanProvider . NAME );
final byte [] output = digest . digest ( "hello world" . getBytes ()); final SecretKeySpec key = new SecretKeySpec ( key , "HMAC-SHA512" );
final Mac mac = Mac . getInstance ( "HMAC-SHA512" , BotanProvider . NAME );
mac . init ( key );
final byte [] output = mac . doFinal ( "hello world" . getBytes ()); final Cipher cipher = Cipher . getInstance ( "AES-256/GCM/NoPadding" , BotanProvider . NAME );
// Never reuse the IV with the same key
cipher . init ( Cipher . ENCRYPT_MODE , key , iv );
cipher . updateAAD ( aad );
final byte [] output = cipher . doFinal ( "hello world" . getBytes ()); final Cipher cipher = Cipher . getInstance ( "AES-256/CBC/PKCS7" , BotanProvider . NAME );
cipher . init ( Cipher . ENCRYPT_MODE , key , iv );
final byte [] output = cipher . doFinal ( "hello world" . getBytes ()); final Cipher cipher = Cipher . getInstance ( "ChaCha20/None/NoPadding" , BotanProvider . NAME );
// Never reuse the IV with the same key
cipher . init ( Cipher . ENCRYPT_MODE , key , iv );
final byte [] output = cipher . doFinal ( "hello world" . getBytes ());