Before I ask questions I understand, that it is important to give some information and background before I do so, on issue related to programing. For quite some time I have been looking around for a way to strings using AES or rijndael. I had done a bit of looking around and my efforts where largely fruitless. One problem lead to another and I had to look around for code that would actually compile. After asking questions and getting no response, combined with looking around the web I did hit gold. I found a library of sorts that would work to encrypt data under AES. It compiled and worked pretty well for files it was slow but usable.
I however wanted to encrypt strings which was my original goal. I tried for some time to replicate the function of this bit of code.
I tried to edit it to encrypt strings rather than files. I made use of the memcpy function however my efforts where fruitless. One problem lead to another and I quickly understood I was in a bit over my head.
I tried to make it work and tried to work around the issues but result remained the same. I might be a bad programer but, a lot of you here are little bit better than bad. So do you have advice or a fix to this problem. http://pastebin.com/nbEV6zkG
I tried several times and I tried different approaches but none worked. http://pastebin.com/nbEV6zkG http://pastebin.com/Mjnvg1Eb https://github.com/SongLee24/Aes_and_Des
lines 15/20 are wrong. You overwrite members of the bitset rather than it's internal data (the 128 bits). sizeof also returns the wrong value. Use a byte array instead.