26278 total geeks with 3498 solutions
Recent challengers:
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
MaxMouse
It's Friday... That's good enough for me!
CodeX
non stop lolz here but thats soon to end thanks to uni, surely the rest of the world is going good?
stabat
how things are going guys? Here... boring...
CodeX
I must be going wrong on the password lengths then, as long as it was done on ECB
MaxMouse
lol... the key is in hex (MD5: of the string "doit" without the "'s) and is in lower case. Maybe i should have submitted this as a challenge!

Donate
Donate and help us fund new challenges
Donate!
Due Date: May 31
May Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
Last time CO2 was
this high, the
world was
underwater? NO,
actually
Boffins find "scary
radio
attack"*
against pacemakers
Pakistan signs up
for China"s GPS
rival
Intel releases
"Beacon Mountain"
Android-on-Atom dev
tool
US boffin builds
32-way Raspberry Pi
cluster
Massive EXPLOSION
visible to naked
eye SEEN ON MOON
Yahoo! Japan says
22 MEELLION User
IDs may have been
nabbed
Nintendo throws
flaming legal
barrel at YouTubing
fans
Optus outlines its
4G future
Hold our tiny
silicon spheres,
say gravity wave
detection
scientists
Slashdot
Music and Movies
Could Trigger
Mobile Malware
Ask Slashdot:
Wiring Home
Furniture?
Medical Firm Sues
IRS For 4th
Amendment Violation
In Records Seizure
Military Dolphins
Discover 1800s
Torpedo
Apple Mobile
Devices Cleared For
Use On US Military
Networks
Mice, Newts
Retrieved After a
Month Orbiting
Earth At 345 Miles
Up
IBM Takes System/z
To the Cloud With
COBOL Update
Google"s Nexus Q
Successor Hits the
FCC
Yahoo Board
Approves a $1.1B
Pricetag For Tumblr
Trade Group: US
Software Developer
Wages Fell 2% Last
Year
Article viewer

Encryption in ASM



Written by:dimport
Published by:sefo
Published on:2003-06-21 07:19:46
Topic:Assembly
Search OSI about Assembly.More articles by dimport.
 viewed 14733 times send this article printer friendly

Digg this!
    Rate this article :
A very simple encryption program in ASM.
I added a few encryption types that you may choose(uncomment line to enable).

;nasm encrypt.asm -o encrypt.com
[org 0100h]
[bits 16]
[section .text]
;Print the message on the screen
mov dx, message
mov ah, 09h
int 21h
start:
;Get a character
mov ah, 08h
int 21h
;Encryption
;add al, 13 ; ROT 13 (encrypt)
;sub al, 13 ; ROT 13(decrypt)
;xor al, 97 ; Simple XOR.
;Print the character
int 29h
;Loop until ^C
jmp start
[section .data]
message db "Type the text you want to encrypt:" , 10 , 13 , "$"

That will only work for DOS since I use DOS interuptions. :(

This article was originally written by shab

Did you like this article? There are hundreds more.

Comments:
inFinie
2004-01-01 17:04:02
ROT13 should get input and give output in alphabetic characters (a-z,A-Z) in your code if al>97 al+13 is not alphabetic. It should be checked if al+13 exceeds a limits (97 or 7F in this case) if so

sub al,26;
;add al,26(decrypt)
will do the job, i think.
inFinie
2004-03-18 20:25:37
ROT13 cipher might be implemeted like below as stated:
;si: string to encrypt
;di: output
Rot13:
    lodsb;load a byte from esi
    or al,al;is it NULL
    jz .exit;if so then exit
.fir:;A-Z check
    cmp al,'A'
    jl .savec;if lessthan A , pass it as it is
    cmp al,'Z';similar
    jg .sec
;here al is between A and Z
add al,13
cmp al,'Z';is it between?
jle .savec;if not
sub al,26;make it between
jmp .savec;save character

.sec:;a-z check whose steps are very similar
    cmp al,'a'
    jl .savec
    cmp al,'z'
    jg .savec

sub al,13
cmp al,'a'
jge .savec
add al,26

.savec:
    stosb

jmp Rot13

.exit:

ret
Anonymous
2008-04-08 19:30:36
SOURCE CODE
Anonymous
2009-10-10 11:03:14
THIS SHIT SUCKS BALLS
Anonymous
2009-11-02 05:35:10
"t":"xt","b":{"x":"myLife","c":"enCmd","p":{"p":"ncjN0/JCrl1u95AlcLK8VXZo92CST8i8BDkUzZex0OAEJpCm1N1XBELvxjpvQEHRDiNIZFyUjJNpT3dDPjctXpRC7Gh1nh9wIBSTt+m2helr/8YQoOr1ihQJ5o/TzMkVs3HZUA68Zj9gbPmOFR6c937zPvY63YmVyXY0rZpfxawg5Vi1pC3J57Zlz5vTDUwAeVapAuwfP8vqSou9I5E3Ra1NT5QiYj9XrYYDBwrE/l0="},"r":27294397}}.
ObatAsamUrat
2011-06-16 07:21:37
That of a wonderful pack involving gifts Honies! I is able to see you are quite anxious about every one of them (whom will not always be?). Naturally you may accomplish canine stone. I have acquired your storm doll i worked out very speedily. Everything to read more doggie snacks. Internet marketing delighted anyone liked your current gifts.
obat asam urat
Anonymously add a comment: (or register here)
(registration is really fast and we send you no spam)
BB Code is enabled.
Captcha Number:


Blogs: (People who have posted blogs on this subject..)
jackier
jackier on Mon 13th Oct 10am
111
sefo
Sneak - encryption on Fri 17th Nov 12pm
I'm developing the win32 version of sneak: http://snarkles.net/scripts/sneak/sneak. php The ASM source code is available on cyberarmy svn (for members only - free) Check the forum for details: http://www.cyberarmy.net/forum/sneak/mes sages/295244.
sefo
Geek Toolbar on Mon 13th Nov 8am
This a very simple and small toolbar I wrote in my spare time. I use the same set of tools very often and I find it very annoying to look for them in the start menu, on the desktop or in explorer. http://www.osix.net/modules/folder/index .php?tid=134
sefo
BinScan and Alternate Data Stream on Thu 27th Jul 9am
BinScan I created this tool to quickly identify modifications in the PE, use of a TLS callback and Alternate Data Streams. -> Some modifications done in the PE structure of an executable can prevent debuggers or other tools to open the executable.
sefo
Wmf Creator on Wed 26th Jul 7am
Now that the blog is online, I'll be able to share two or three tools I wrote. The first one I'd like to share is WMF Creator. I already put a link in the comments of my article: Wmf Exploit but I thought it would look nicer here. This tool will tak

Test Yourself: (why not try testing your skill on this subject? Clicking the link will start the test.)
Reverse Engineering by Geek_Freek

A test to check your assembly and reversing skills.
Assembly Language - non compiler specific by TroPe

You can test your assembly knowledge by taking this test. It starts out relatively easy, but gets progressively hards very quickly! If you know assembly, or just want to see what you DONT know about assembly, this test is for you. A more advanced assembly


     
Your Ad Here
 
Copyright Open Source Institute, 2006