BetaArchive Logo
Total Current Archive Size: 4765.54GB in 15409 files
Navigation Home Screenshots Image Uploader Server Info FTP Servers Wiki Forum RSS Feed Rules Please Donate
UP: 8d, 14h, 5m | CPU: 18% | MEM: 5130MB of 12279MB used
{The community for beta collectors}

Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPost subject: Encryption in Asm        Posted: Fri Oct 14, 2011 1:59 am 
Amateur Beta Collector
Amateur Beta Collector
User avatar
Offline

Joined
Fri Dec 24, 2010 11:12 pm

Posts
179

Location
/dev/chair

Favourite OS
DreckigOS v0.007 Alpha
I am working on an kernel for my Real mode OS in Asm. x86, of course.
I want to write a subroutine for encryption of text input.
It doesn't need to be complicated, I was thinking just shift the ASCII value by an arbitrary number. I tried, but am not having any luck.
Help!!!

_________________
GAT C++++$
DreckigOS - Now bigger and better:
https://github.com/WizardOfHaas/DreckigOS


Top  Profile  WWW
 PostPost subject: Re: Encryption in Asm        Posted: Fri Oct 14, 2011 4:16 am 
Pro Beta Collector
Pro Beta Collector
User avatar
Offline

Joined
Tue Feb 19, 2008 1:52 am

Posts
524

Favourite OS
xboxkrnld.15574
A simple xor would do this for you, not sure what that is in x86 though

_________________
Image


Top  Profile
 PostPost subject: Re: Encryption in Asm        Posted: Sat Mar 03, 2012 4:59 pm 
Newbie Beta Collector
Newbie Beta Collector
Offline

Joined
Sun Feb 26, 2012 10:34 pm

Posts
13

Favourite OS
Chicago
I would suggest you to get a hold of the Phalkon Skism tutorials in virii making. There is quite a lot about encryption/decryption routines in Assembly. Normally you would go for a XOR cycle, if you want to keep it simple, but you can also make it more interesting, using an encryption that supports private and public keys.


Top  Profile
 PostPost subject: Re: Encryption in Asm        Posted: Thu Apr 19, 2012 6:08 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Thu Dec 22, 2011 2:51 pm

Posts
72

Favourite OS
NeXTStep/OpenStep
Hi,

the problematic thing with shifts is that they are 'lossy'. When you shift the value 65 (Character 'A', 01000001 Binary) by,
lets say, 4 places to the right, you get 00000100. The right shift operation places binary zeros to the at left-most positions.
But when you now do the oposite operation, a left shift, which places binary zeros at the right-most places, you get
01000000, which is a decimal 64 and not 65 which would be the value you expect !!!

So said that the shift-operations are lossy, you need a lossless operation, such as rotation and/or XORing.
You could, for example, combine rotation with XORing. In the first phase rotate a byte and in the second phase you could
XOR the rotated value by a constant (Encryption). In the Decryption phase do the operations you did in the Encyption
phase in the oposite order: Here first XORing than rotation

Encryption: ENC(x) = ROTATE-LEFT (x, 4) XOR 0x65
Decryption: DECR(x) = ROTATE-RIGHT (x XOR 0x65, 4)

That's all
With regards,
Martin

_________________
Collector of old Windows SDKs (or generally of rare SDKs). My collection could be accessed here.


Top  Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

All views expressed in these forums are those of the author and do not necessarily represent the views of the BetaArchive site owner.

Powered by phpBB® Forum Software © phpBB Group

Copyright © 2006-2013

 

Sitemap | XML | RSS