4

I need crypto-algorithm AES in key wrap mode. Is there some open-source library or implementation that could be helpful?

It is important, that it must be key wrap mode.

Ariel Grabijas
  • 1,412
  • 5
  • 24
  • 45

2 Answers2

8

The standard SunJCE provider offers an implementation of RFC 3394. Just use the algorithm AESWrap:

Cipher c = Cipher.getInstance("AESWrap", "SunJCE");
c.init(Cipher.WRAP_MODE, secretKey);
byte[] result = c.wrap(someKey);
Duncan Jones
  • 63,838
  • 26
  • 184
  • 242
1

BouncyCastle supports key wrapping in AES with the AESWrapEngine.

You can look at this StackOverflow post to see more examples of BouncyCastle. The only difference is you will specify the AESWrapEngine instead of the AESEngine.

Community
  • 1
  • 1
vcsjones
  • 133,702
  • 30
  • 291
  • 279