TLINDEN/Crypt--PWSafe3 — pull request #2 by Mekk (2012-11-18 00:18:16+00:00)
Title: Important performance fix and fix for some warning (which maybe leaked data?)

Note: please, review those fixes!

I offer two changes. Smaller one removes the warning I was sometimes observing while processing pwsafe file made by gui app (on some unknown field). I am not 100% sure whether this warning could lead to data loss but it is possible.

Second fix drastically improves performance (especially - of save). As module worked very slowly for me (a couple of minutes to save the file on both Ubuntu 10.04 and 12.04), I profiled it and found that it spends almost all time inside Crypt::PWSafe3::random function. I swapped it with some secure bytes generator from CPAN and got save in 0.5 second (~ 500 times faster). The change in fact replaces using /dev/urandom for all cryptography with using it only for seeding algorithmic generator.

If you hesitate to acept the change in such a form, I would be grateful if you allowed to plug user-provided random function into the library somehow.