Initialize the IV... On Sep 10, 8:03 pm, Jamie <[EMAIL PROTECTED]> wrote: > Ok, I THOUGHT I understood how this whole thing worked and I had a > streaming cipher solution all happy and encrypting/decrypting. But I > switched from Debug mode to Release mode, and it appears that the > major difference is that debug mode initializes stuff to 0's... so > when I switched to Release all my enc/decrypt stuff... well... broke : > ( > > I am attempting to stream encryted data to a file, and then decrypt it > later. Because the data is not ready all at once, I can't just do one > big encrypt at the end (otherwise this would be so easy). Anyone care > to point out, likely obvious to everyone but me, the part where I'm > going wrong? > > ---------------------------------------------------- > //initialize > > byte key[16], iv[16]; > > /* Create some key here, but NOT making the iv yet. > IV is just random garbage at the moment. */ > > ::memcpy(key, "blahblahblahblah", 16); > > CryptoPP::Sosemanuk::Encryption enc(key, 16, iv); > CryptoPP::Sosemanuk::Decryption dec(key, 16, iv); > > /*Create filename, and create an IV based on the filename*/ > enc.Resynchronize(iv); > > /*receive a string of data */ > > enc.ProcessString(encoded, stringofdata, lengthofstringofdata); > > /*write encoded to file*/ > > /*Oops! File is 'full', make a new file, create a new filename, > and make a new iv based on that filename*/ > enc.Resynchronize(iv); > > /*Go back to receiving strings,encoding and writing them*/ > > ------------------------------------------------------- > > Is this approach reasonable? Possible? The idea is to have a common > 'key' amongst all the files, but change the IV for each individual > file. This would allow third parties to decrypt the files if > necessary. Just know the common key, and how to build the IV from the > filename. > > Is this even feasible? Or, as I suspect, is my grasp of this whole > encryption business just a wee bit... well... wrong. Any help/insight > will of course be greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [EMAIL PROTECTED] More information about Crypto++ and this group is available at http://www.cryptopp.com. -~----------~----~----~----~------~----~------~--~---
