On Mon, Dec 10, 2007 at 06:43:34PM -0800, karthickramu wrote:

> Hi
> 
>  
> 
> Can any one help me on how to configure / add AES 128 bit Counter mode
> encryption for OpenSSL.
> 
> When i use "openssl enc help " I don't see AES_128_CTR in the Cipher types
> list. Any help will be deeply appreciated.

There is no command-line interface for CTR mode, however the C-API
is available:

    #include <openssl/aes.h>

    void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
            const unsigned long length, const AES_KEY *key,
            unsigned char ivec[AES_BLOCK_SIZE],
            unsigned char ecount_buf[AES_BLOCK_SIZE],
            unsigned int *num);

Initialize "num" to zero and ivec[] to a suitable 128-bite nonce (starting
value for the counter). If using to enrypt a stream, resume with the
"n", "ivec", anc ecount_buf[] values from the previous iteration (all
are modified).

-- 
        Viktor.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to