Re: [openssl-users] BIO_seek() on bio_f_cipher with EVP_aes_256_ctr

2016-08-11 Thread Dr. Stephen Henson
On Thu, Aug 11, 2016, William King wrote: > > > Does the BIO_seek() not handle incrementing or decrementing the IV > counter? is there a callback that needs to be set to calculate what the > IV counter value should be for a given file position for the cipher? > Calling BIO_seek() on a chain

Re: [openssl-users] BIO_seek() on bio_f_cipher with EVP_aes_256_ctr

2016-08-11 Thread Salz, Rich
> Does the BIO_seek() not handle incrementing or decrementing the IV > counter? is there a callback that needs to be set to calculate what the IV > counter value should be for a given file position for the cipher? It does not. -- openssl-users mailing list To unsubscribe:

Re: [openssl-users] BIO_seek() on bio_f_cipher with EVP_aes_256_ctr

2016-08-11 Thread William King
Same decryption issue happens if I run something like: char buffer[1024] = {}, buffer2[1024] = {0}; size_t pos = BIO_tell(enc); BIO_read(enc, buffer, 1024); BIO_seek(enc, pos); BIO_read(enc, buffer2, 1024); if (memcmp(buffer, buffer2, 1024)) { printf("Mismatched\n"); } else { printf("Matched\n");

Re: [openssl-users] BIO_seek() on bio_f_cipher with EVP_aes_256_ctr

2016-08-11 Thread William King
Without any of the error checking code in place, this is what I'm testing: /* START CODE BLOCK */ const EVP_CIPHER *cipher = EVP_aes_256_ctr(); const EVP_MD *digest = EVP_sha256(); BIO *enc = BIO_new(BIO_f_cipher()); BIO *in = BIO_new(BIO_s_file()); EVP_CIPHER_CTX *ctx = NULL; char *path =

[openssl-users] BIO_seek() on bio_f_cipher with EVP_aes_256_ctr

2016-08-09 Thread William King
What is needed to be able to BIO_seek() on a bio_f_cipher() with a cipher of EVP_aes_256_ctr() without the counter, or IV or another internal state getting corrupted? It seems that doing a seek any direction results in corrupted output. -- William King Senior Engineer Quentus Technologies, INC