Java Cryptography Concepts: Difference between revisions
Jump to navigation
Jump to search
(→Cipher) |
(→Cipher) |
||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
{{External|https://docs.oracle.com/javase/8/docs/api/javax/crypto/Cipher.html}} | {{External|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== | ==Cryptographic Algorithm== | ||
Line 17: | Line 19: | ||
==Feedback Mode== | ==Feedback Mode== | ||
===CBC=== | |||
CBC requires IV. | |||
===ECB=== | |||
==Padding Scheme== | ==Padding Scheme== | ||
Example: "PKCS5Padding" | Example: "PKCS5Padding" |
Latest revision as of 08:20, 24 November 2018
Internal
Java Cryptographic Extension (JCE) Framework
Cipher class is the core of JCE.
Cipher
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"