I am looking for some algorithm to scramble/encrypt my Ascii values (entered text) preferably more... clever way - than offered on this site: http://cryptoclub.org/tools/letter_tonumber.swf
All my entered text is plain Ascii (A = 65, B = 66, C = 67 and so on...)
User entered password is also plain Ascii, so I have two sets of numbers (first one for entered text, and second (shorter one) for entered password), so the goal is to "scramble" the first set of numbers by using the second set of numbers)?
It should support full Ascii (0 - 255) but outputed ("scrambled") values for each "coded" number (at the end) can really be anything; starting from negative to positive (preferably real, meaning - preferably no integer) numbers...)
Something more clever for ASCII encryption than this?
-
- Squad Leader
- Posts: 774
- Joined: Sat May 21, 2011 7:21 pm
- Location: Between UK and France
- Contact:
Re: Something more clever for ASCII encryption than this?
I don't see the point of using non integer value for the end result, integer are more easy to process, the Oric is a really slow device.
And there are plenty of encryption algorithm that exist, I wonder what you really want to do, and I think that "strong encryption" on the Oric is basically useless
Could you explain why you use that because it completely change a possible answer.
And if you really want decimal numbers, a simple math equation that can be reversed is more than enough, but need to be sure you'll never get a rounding problem or all of your thing will be failing.
And there are plenty of encryption algorithm that exist, I wonder what you really want to do, and I think that "strong encryption" on the Oric is basically useless
Could you explain why you use that because it completely change a possible answer.
And if you really want decimal numbers, a simple math equation that can be reversed is more than enough, but need to be sure you'll never get a rounding problem or all of your thing will be failing.
My Projects: Replic'Oric Project - StratoCumulus Project
Re: Something more clever for ASCII encryption than this?
If you don't need strong (serious) encryption a simple exclusive or byte by byte between user and pass will do.
Obviously it won't withstand the simplest serious attack...
Obviously it won't withstand the simplest serious attack...
Re: Something more clever for ASCII encryption than this?
You could use the ROM (area from C000 to FFFF) to "encrypt" the values:
Code: Select all
FOR index=0 to length
encrypted[index]=source[index] XOR (PEEK(#C000+index)+index)
NEXT
Re: Something more clever for ASCII encryption than this?
As little improvement of Dbug's version you can use the password to generate starting offset in the range $0000..$3FFF and add it to the base $C000, or:
The only drawback of this 'algo': it depends on ROM content - if text is encrypted on Oric-1 it can't be decrypted on Atmos .
Code: Select all
offset = 0
FOR index=0 to password_length
offset = (offset * 2) XOR password[index]
NEXT
offset = offset AND #3FFF
FOR index=0 to length
encrypted[index]=source[index] XOR (PEEK(#C000+offset))
offset = (offset + 1) AND #3FFF
NEXT