It has a password protection and it is simple to modify.
A key file will be generated (scrabmlekey.tbl) without this file you can't decrypt it. :)
Have fun :)
Code: Select all
const otext ="HELLO BEAUTYFUL WORLD"
const password = "DecryptME"
type sc_data
t as uinteger
d as uinteger
end type
dim as string mtext = otext
dim as string passw = password
'###ENCRYPTION###
randomize timer
'LEVEL 1 - MESSAGE SCRAMBLING
open "scrabmlekey.tbl" for binary as #1
dim as sc_data a(len(otext))
for i as integer = 0 to len(otext)-1
a(i).t = int(rnd*len(otext))
a(i).d = int(rnd*len(otext))
put #1,,a(i).t
put #1,,a(i).d
swap mtext[a(i).t],mtext[a(i).d]
next
close #1
'LEVEL 2 - ADD ZEROS (MAKES THE STRING LONGER)
dim as string modtext
for i as integer = 0 to len(mtext)-1
if int(rnd*2)=1 then
for i as integer = 1 to 4
modtext+=CHR(0)
next
end if
modtext+=chr(mtext[i])
next
mtext = modtext
'LEVEL 3 - XOR CRYPTING WITH PASSWORD
for i as integer = 0 to len(mtext)-1
mtext[i]=mtext[i] xor passw[i mod len(password)] + I
next
erase(a)
print "ENCRYPTED TEXT :";mtext
'###DECRYPTION ###
'LEVEL 1 - XOR CRYPTING WITH PASSWORD
for i as integer = 0 to len(mtext)-1
mtext[i]=mtext[i] xor passw[i mod len(password)] + I
next
'LEVEL 2 - REMOVE ZEROS
modtext = ""
for i as integer = 0 to len(mtext)-1
if mtext[i] > 0 then modtext+=chr(mtext[i])
next
mtext = modtext
'LEVEL 3 - DECSCRAMBLING
print "Loading scrablekeys.."
open "scrabmlekey.tbl" for binary as #1
get #1,,a()
close #1
print "Decryption in progress.."
for i as integer = len(otext)-1 to 0 step -1
swap mtext[a(i).t],mtext[a(i).d]
next
Print "DECRYPTED TEXT :";mtext
sleep