On Sat, Mar 19, 2011 at 21:48, Robert F. <[email protected]> wrote: > > The purpose of using the trimmed sha1 is because the key is defined by the > user, I'm using the AES algo for username/password purposes. > I suggest that you carefully examine the set of assumptions that lead you from "the key is defined by the user" to "I should use a truncated sha-1 hash of the user-defined key as my AES key." Nothing about the key being defined by the user makes what you're doing necessary :-).
> I'm not quite sure what is meant in #1, can you provide an example? > I'm on a mobile at the moment and it's too cumbersome for me to search, copy and paste. Just grep -i pbkdf validat*.cpp within the crypto++ source distribution. You'll find an example of using one. > As for #2, all data output must be in hex, ASCII is not allowed by the > program. So, how would I go about fixing this to be correct? Would usage of > Base64 Encoding over the IV/String work? because B64 is acceptable. It doesn't matter how you encode the output or IV. Encode them in whatever way is suitable for your transport. That's not the problem. The problem is decoding them into string types that aren't meant to hold arbitrary binary data. (Sorry... I thought my commented snippet illustrated that.) Decode them into an array of bytes instead. The SecByteBlock type in crypto++ should be convenient for this kind of thing. Good luck. Geoff -- 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.
