In message <000001c2aa3d$ed41bab0$7c03fdcb@the9note> on Mon, 23 Dec 2002 13:44:06 
+0900, 김덕우\(Deokwu, Kim\) <[EMAIL PROTECTED]> said:

thenine> void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
thenine>        const unsigned long length, const AES_KEY *key,
thenine>        unsigned char counter[AES_BLOCK_SIZE],
thenine>        unsigned char ecount_buf[AES_BLOCK_SIZE],
thenine>        unsigned int *num)
thenine> 
thenine> The 'in' and 'out' is plaintext(ciphertext) and ciphertext(plaintext).
thenine> The 'key' is key value. The 'length' is block length value...
thenine> But I don't know the other value...(And How to decrypt the ciphertext?
thenine> The other mode use a value of 'AES_ENCRYPT' or 'AES_DECRYPT'.)

Since the counter mode requires certain temporary values to be held
between calls, you need to provide them.  Those are two buffers (which
need to be initialised with '\0's) and a block offset indicator (so
the counter mode can be used as a stream cipher), which also needs to
be initialised to 0.

You decrypt with the encrypt function, since the encryption per se
really is just an XOR operation.

-- 
Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
Redakteur@Stacken  \ S-168 35  BROMMA  \ T: +46-8-26 52 47
                    \      SWEDEN       \ or +46-708-26 53 44
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to