Ah and one other thing!
What is this crypto algorithm you speak of? I desperately need some sort of encryption as at the moment anyone can simply open the text file and change the numbers to numbers that work!
Where can I learn more about it?
Given the use of the term "pasw" (and variants thereof) in the snipped
text...
Are you trying to password protect access to the program (ie, a
"login"), or hide the data in a recoverable state.
Many "login" type passwords aren't encrypted -- they are hashed,
possibly with a random starting seed created when the "login account name"
is entered to the system. These never recover the password itself (well,
supposedly they didn't but I believe cracks were found in the Linux passwd
file such that the hash is now stored in a system level file in parallel,
while the passwd file may have just the basics of the user login/owner/etc.
-- since passwd had to be accessible to most user level programs).
For "login", one matches the username in the password file, extracts
the seed, then hashes the entered password -- the hash has to match the one
in the file to be valid. If the user forgets the password, there is no way
to recover it -- the most a sysop can do is generate a new password, enter
its hash into the file, and tell the user what the new password is (along
with instructions to change it as soon as they log in).
For data hiding, a prior post provides information regarding symmetric
(same key used in both directions -- a very simplistic approach would be to
just XOR the data with the key (but this will reveal the length of the key
if the data has a large stretch of identical values, say a line of
------------------------------------------------------
as the repeats of the shorter key will create the same output sequence). In
the late 70s, the DES (data encryption standard) algorithm was supposed to
be practically unbreakable by brute force (trial and error) and secure
enough for international banking. 20 years later, desktop machines could
break it in a few weeks, if not sooner, and Triple-DES came into use.
Problem with symmetric keys? Both sides have to know the key before
data can be transferred, and anyone who discovers the key can
decrypt/modify/encrypt the data.
Asymmetric (public key) systems use a pair of keys. One key is used to
encrypt the data. The other key is used to decrypt it. They only work in
one direction. If you publish the encryption key, anyone can use it to
encrypt data which then can be sent to you, but only you can decrypt it
with the other key. Vice versa, if you publish the decryption key but keep
the encryption key secret, you can encrypt data that anyone with the public
key can decrypt and read -- but only you can provide the data (this is how
"signing" is normally done; only the holder of the signing encryption key
could produce the signature).