Re: AES encryption with openssl bindings

2014-04-26 Thread hane via Digitalmars-d-learn
AES_set_decrypt_key is needed before AES_decrypt. AES_set_decrypt_key(chunk.ptr, 128, wctx);

Re: AES encryption with openssl bindings

2014-04-26 Thread Kagamin via Digitalmars-d-learn
On Friday, 25 April 2014 at 19:06:33 UTC, brad clawsie wrote: My code compiles and fails silently. How do you want it to fail? C code doesn't throw exceptions.

AES encryption with openssl bindings

2014-04-25 Thread brad clawsie via Digitalmars-d-learn
hi everyone. I'm trying to symmetrically encrypt some text using the openssl bindings. My code compiles and fails silently. Clearly there is something very wrong with it - it could be my novice D skills, or my misuse of the openssl binding. auto chunk = new ubyte[](16); foreach(ref

Re: AES encryption with openssl bindings

2014-04-25 Thread Justin Whear via Digitalmars-d-learn
On Fri, 25 Apr 2014 19:06:31 +, brad clawsie wrote: hi everyone. I'm trying to symmetrically encrypt some text using the openssl bindings. My code compiles and fails silently. Clearly there is something very wrong with it - it could be my novice D skills, or my misuse of the openssl

Re: AES encryption with openssl bindings

2014-04-25 Thread bearophile via Digitalmars-d-learn
Justin Whear: brad clawsie: b = cast(ubyte[]) s; Better to use std.string.representation. It doesn't look like you're allocating space for `e` or `d`, e.g. `auto e = new ubyte[](256);`, so those arrays have a length of 0, in which case the encrypt/decrypt functions are just trashing