java-cryptography

Why java.security.NoSuchProviderException No such provider: BC?

The jar (bcprov-jdk16-145.jar) has been added to the project, Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()) has been added to the class, and BouncyCastleProvider.PROVIDER_NAME does return "BC" but AesFileIo.writeFile() still throws java.security.NoSuchProviderException No such provider: BC. Any ideas? im...

hmac message encryption but using our own key

try { // Generate a key for the HMAC-MD5 keyed-hashing algorithm KeyGenerator keyGen = KeyGenerator.getInstance("HmacMD5"); SecretKey key = keyGen.generateKey(); // Generate a key for the HMAC-SHA1 keyed-hashing algorithm keyGen = KeyGenerator.getInstance("HmacSHA1"); key = keyGen.generateKey(); } catch ...