RUBY - A simple encrypter
1
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






There are currently no comments for this snippet.