File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/main/java/org/owasp/esapi/crypto Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -795,6 +795,15 @@ protected boolean canEqual(Object other) {
795795 * <pre>
796796 * HMAC-SHA1(nonce, IV + plaintext)
797797 * </pre>
798+ * Note that <i>only</i> HMAC-SHA1 is used for the MAC calcuation. Unlike
799+ * the PRF used for derived key generation in the {@code KeyDerivationFunction}
800+ * class, the user cannot change the algorithm used to compute the MAC itself.
801+ * One reason for that is that we don't want the MAC value to be excessively
802+ * long; 128 bits is already quite long when only encrypting short strings.
803+ * Also while the NSA reviewed this and were okay with it, Bellare, Canetti & Krawczyk
804+ * proved in 1996 [see http://pssic.free.fr/Extra%20Reading/SEC+/SEC+/hmac-cb.pdf] that
805+ * HMAC security doesn’t require that the underlying hash function be collision resistant,
806+ * but only that it acts as a pseudo-random function, which SHA1 satisfies.
798807 * @param ciphertext The ciphertext value for which the MAC is computed.
799808 * @return The value for the MAC.
800809 */
You can’t perform that action at this time.
0 commit comments