recreating C code for aes-128-cfb

View: New views
2 Messages — Rating Filter:   Alert me  

recreating C code for aes-128-cfb

by marty-32 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have an encrypted block of a number of bytes (>10k).

When I run openssl (with the newest release) I'm doing:
 sprintf(command, "openssl enc -aes-128-cfb -d  -K %s -iv %s >>test.ogg", hexkey, iv)

(where hexkey and iv are hexified character arrays...)

and it works fine through popen...

I've played around with various

AES_cfb*_encrypt calls (with a loop that does 16 bytes at a time).

I can't get it to work...is there a "way" to a simple way to put the above
command line in C code (where I can supply input/output arrays?)

marty


     
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@...
Automated List Manager                           majordomo@...

Re: recreating C code for aes-128-cfb

by Brad House :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I've played around with various
> AES_cfb*_encrypt calls (with a loop that does 16 bytes at a time).
> I can't get it to work...is there a "way" to a simple way to put the above
> command line in C code (where I can supply input/output arrays?)

You should be on openssl-users, this is not an appropriate
question for openssl-dev.

The answer to your question is in the docs:
http://openssl.org/docs/crypto/EVP_EncryptInit.html
(look at the examples)

Just instead of using EVP_bf_cbc() as the cipher, you'd
just use EVP_aes_128_cfb()...

-Brad
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@...
Automated List Manager                           majordomo@...