AES-CTR

B

bytebro

Hi,

I have had a browse around CPAN, and can't quite find what I'm looking
for, so I was wondering if anyone might be able to point me in the
right direction.

I have a C program which does the following:

Given a pseudo-random salt (8 bytes) and user-supplied passphrase, it
uses RFC3686 (PKCS #5) to produce a 256-bit AES key, and a 16-byte IV.
The salt value is broadcast as a header to the ciphertext.

It encrypts the plaintext in CTR mode, XORing an 8-byte counter into
the IV to give a counter block prior to each encryption.

It appends a 16-byte MAC produced using OMAC1/CMAC to the ciphertext.

My quest is to find a module or set of modules which allow me to
duplicate this processing in Perl. The Rijndael modules I found don't
seem to support CTR mode, so I'd have to roll that myself in the body
of the code, I guess; the only other CTR-related module I found seems
not to support an 8-byte counter and confesses itself to be very slow.
I found a Digest::CMAC module, but nothing for the PKCS #5 key
derivation.

Any ideas, please?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top