Encrypt passwords with the Dynarex-password gem
I have been using the Dynarex-password gem to encrypt my passwords for several years now. Here's how it works:
- Basically a lookup file is generated containing 1 or 2 random alphanumerical characters which are mapped to each letter of the alphabet.
- Supply a weak password (e.g. secret1) and it will return the associated random character(s) for each character in your password.
- To decipher the strong password the script looks up the character associated with the random character(s).
Example
require 'dynarex-password'
file = 'lookup.xml'
dp = DynarexPassword.new
dp.generate_lookup(fixed_size=2)
dp.save 'lookup.xml'
dp.lookup('secret1', file)
dp.reverse_lookup("gozyCR1lzyUmKQ", file)
Note: If a lookup file is generated without a fixed size, then a reverse lookup isn't possible.
- Tags:
- Source:
- 1731hrs.txt
- Published:
- 17-07-2013 17:31