Java Cryptography Concepts

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Java Cryptographic Extension (JCE) Framework

Cipher class is the core of JCE.

Cipher

https://docs.oracle.com/javase/8/docs/api/javax/crypto/Cipher.html

Cipher instances are not threads-safe. If multiple threads need to perform encryption/decryption, Cipher instances need to be stored in ThreadLocal, obtain a new instance every time is needed, or wrapped in a synchronized block.

Cryptographic Algorithm

Example: "AES"

Feedback Mode

CBC

CBC requires IV.

ECB

Padding Scheme

Example: "PKCS5Padding"