On Tuesday, December 3, 2013 11:56:59 AM UTC-5, cyberc123 wrote: > > Hello, > I am trying to use this library on iOs and have encountered multiple > problems in it's use: > > > http://crypto.stackexchange.com/questions/12077/ivs-from-crypto-autoseededrng-always-ends-the-same-problem-with-the-prng/12092?noredirect=1#12092 > > http://stackoverflow.com/questions/20290487/crypto-what-to-do-with-the-iv/20326211?noredirect=1#comment30342582_20326211 > It looks like you are using a HexEncoder rather than a Base64Encoder.
Base64Encoder takes a 2nd argument that specifies if you want the line breaks. You should use 'false' to omit the line break rather than trying to strip it manually. See http://www.cryptopp.com/docs/ref/class_base64_encoder.html. Do something like this: AutoSeededX917RNG<Serpent> rng; byte iv[Serpent::BLOCKSIZE]; string encoded; rng.GenerateBlock(iv, sizeof(iv)); StringSource ss(iv, sizeof(iv), true, new Base64Encoder( new StringSink(encoded), false /* line break */ ) // Base64Encoder ); // StringSource cout << encoder << endl; Jeff -- -- 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. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
