Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AES key wrap encryption

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.

like image 484
Ariel Grabijas Avatar asked Jan 14 '23 09:01

Ariel Grabijas


1 Answers

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);
like image 152
Duncan Jones Avatar answered Jan 22 '23 02:01

Duncan Jones