From: Mark Probert Date: 2003-01-18T06:09:15+09:00 Subject: Re: [ANN] dbi-dbrc 0.2.0 Hi. At 11:56 PM 1/17/2003 +0900, Dan wrote: > > Is the password hashed in file? > > > > many thanks -botp > >No, it's plain text, but see the four rules for the .dbrc file before your >eyes pop out. >... >That being said....plugins welcome. :) Will this help. -mark. # ----- # Crypto -- a class to do some simple crypto stuff # class Crypto DefSeed = "1913241303102769784369176881852378684052287024444246184380987196" RandStr = "4]fdsfA94kk4t380t4" def crc32(c) r = 0xFFFFFFFF c.each_byte do |b| r ^= b 8.times do r = (r>>1) ^ (0xEDB88320 * (r & 1)) end end r ^ 0xFFFFFFFF end # "\236\230x\250\237\223d\224" def encrypt(str) s = str.dup + RandStr n = 0 s.length.times do s[n] = (s[n] + DefSeed[n] - 48).chr.to_s n += 1 end return s end def decrypt(str) s = str.dup n = 0 s.length.times do s[n] = (s[n] - DefSeed[n] + 48).chr.to_s n += 1 end return s.slice!(0, s.length - RandStr.length) end end