954,157 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

encryption

emergent;help i a project in encryption any text of alphapets and numbers into a random characters(from A-Z and 0-9 numbers)
using assembly
if u please

raseel
Newbie Poster
10 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 
encryption any text of alphapets and numbers into a random characters


; do you want later to decrypt it back or no?

low_coder
Junior Poster in Training
55 posts since Nov 2008
Reputation Points: 40
Solved Threads: 4
 

yes encryption and decryption code
and reading the text from a text file
thanks

raseel
Newbie Poster
10 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

Start simple - write a program which just copies the file, one character at a time.

Until you can do that reliably, there's no point trying to implement a crypt/decrypt, because you'll have no way to test it.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

; here is a simple encrypting/decrypting app.:
; on encryption it will just inc hex values represented byeach char
; on decryption dec

.386
	.model flat,stdcall
	option casemap:none
	include \masm32\include\windows.inc
	include \masm32\include\user32.inc
	include \masm32\include\kernel32.inc
	include \masm32\include\masm32.inc
	includelib \masm32\lib\user32.lib
	includelib \masm32\lib\kernel32.lib
	includelib \masm32\lib\masm32.lib

.data?
	szBuff				db  256 dup(?)
.code
start:
invoke AllocConsole
invoke StdIn, ADDR szBuff, sizeof szBuff

lblCrypt:
mov eax, offset szBuff
@@:
cmp byte ptr [eax],0
je lblPrint
inc byte ptr [eax]
inc eax
jmp @B

lblPrint:
mov eax, offset szBuff
invoke	StdOut, ADDR szBuff

lblDecrypt:
mov eax, offset szBuff
@@:
cmp byte ptr [eax],0
je lblExit
dec byte ptr [eax]
inc eax
jmp @B

lblExit:
mov eax, offset szBuff
invoke	StdOut, ADDR szBuff
invoke	ExitProcess, 0
end start
low_coder
Junior Poster in Training
55 posts since Nov 2008
Reputation Points: 40
Solved Threads: 4
 

thanks a lot .but it is only allowed for me to use TASM for 8086 ,and u here used MASM ,it is a little bit different could u help me to do this
thanks again

raseel
Newbie Poster
10 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You