Encryption and Decryption



Encryption and Decryption



.model small
print macro c
mov ah,09h
leadx,c
INT 21H
endm

.data
valuedb 'akilesh', '$'
vsizedw $-value
encryptdb 10 dup(?)
decryptdb 10 dup(?)
msg1db "original msg:$"
msg2db 0ah,0dh, "encrypted msg $"
msg3db 0ah,0dh, "decrypted msg $"

.code
.startup

movbx,@data
movds,bx
moves,bx
leasi,value
leadi,encrypt
movcx,vsize
dec cx

print msg1
print value

counter1: mov ah,0000h
                mov al,[SI]
                add al,05h
                mov [di],al
                incsi
                inc di
                loop counter1
                mov di,"$"
                print msg2
                print encrypt
                leasi,encrypt
                leadi,decrypt
                movcx,vsize
                dec cx

counter2: mov ah,0000h
                mov al,[SI]
                sub al,05h
                mov [di],al
                incsi
                inc di
                loop counter2
                mov di,"$"
                print msg3
                print decrypt
.exit
End



0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More