Liberty BASIC Community Forum
« encryption_snippet »

Welcome Guest. Please Login or Register.
Jan 20th, 2018, 11:02am

Rules|Home|Help|Search|Recent Posts|Notification

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: encryption_snippet  (Read 456 times)
New Member

member is offline



Posts: 5
xx encryption_snippet
« Thread started on: Apr 7th, 2017, 09:58am »

'this takes a sentence that you write, turns each letter into its asci 'number,
'does operations on it, so that if someone were to open the file
'in notepad, they would be unable to read it, even if they knew the
'asci number
'the files can then be protected with a password, within the program
'and then they are secure
'the program can retrieve the data, and turn it back into whatever
'you were meaning to store
dim array$(1000)
open "encryptfil" for output as #encrypt
input "Please enter a sentence>"; sentence$
if sentence$ = "" then [retry]
for i = 1 to len(sentence$)
var$ = right$(sentence$, i)
firstletter = asc(var$)
firstletter = (((firstletter * 5) - 5) + 3)
print #encrypt, firstletter
next i
close #encrypt
input "Would you like to see what was output to the file? (type 'yes'): "; inputvar$

if inputvar$ = "yes" then [seewhat]

open "encryptfil" for input as #encrypt
n = n + 1
if eof(#encrypt) = -1 then [print]
input #encrypt, number
print number
num = (((number - 3) + 5) / 5)
print num
line$ = chr$(num)
array$(n) = line$
goto [loop]

input "Would you like to see what the data turned back into what you wrote? (type 'yes'): "; inputvar$
wordy$ = wordy$ + array$(n)
n = n - 1
if array$(n) = "" then [end]
goto [printloop]
print wordy$
close #encrypt

« Last Edit: Apr 7th, 2017, 10:07am by tommarch » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls