Page 1 of 1

Something more clever for ASCII encryption than this?

Posted: Sat Jan 30, 2016 7:46 pm
by Brana
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...)

Re: Something more clever for ASCII encryption than this?

Posted: Mon Feb 01, 2016 7:18 pm
by Godzil
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.

Re: Something more clever for ASCII encryption than this?

Posted: Mon Feb 01, 2016 8:44 pm
by Chema
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...

Re: Something more clever for ASCII encryption than this?

Posted: Mon Feb 01, 2016 10:28 pm
by Dbug
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?

Posted: Tue Feb 02, 2016 12:05 am
by iss
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:

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
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 ;).