RUBY - A simple encrypter





1
Date Submitted Mon. Jun. 9th, 2008 3:54 AM
Revision 1 of 1
Helper jamesmcm
Tags Encryption | Ruby
Comments 0 comments
A quick implementation of an encrypter which can't be cracked by frequency analysis.

 n=0

 File.open('text.txt', 'r') do |f1| 
   
   while line = f1.gets 
      text=line
         
        end
        n=0
        text2=Array.new(text.length)
while n<text.length
text2[n]=text[n]
n=n+1
end

n=0
        text3=Array.new(text.length)
while n<text.length
text3[n]= (n*n*n)+(n*n)+n+text.length+text2[n]
n=n+1
end
text4=text3.join(",")

File.open('encrypt.txt', 'w') do |f2|
  f2.puts text4
  end

end
 

james mcm

Comments

There are currently no comments for this snippet.

Voting

Votes Up


Helper jamesmcm

Votes Down