Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Assembly Language

Name: Anonymous 2009-04-29 18:35

Can someone explain to me how i would go about doing this?

Let the user enter and encryption key consisting of multiple characters. Use this key to encrypt and decrypt the plain-text by XORing each character of the key against a correponding byte in the message. Repeat the key as many times a necessary untill all plain-text bytes are translated.


KEY = 239
BUFMAX = 128

.data
sPrompt  BYTE "Enter the plain text: ",0
sEncrypt BYTE "Cipher text:             ",0
sDecrypt BYTE "Decrypted:             ",0
buffer   BYTE    BUFMAX+1 DUP(0)
bufSize    DWORD    ?

.code
main PROC
    call InputTheString
    call TranslateBuffer
    mov  edx,OFFSET sEncrypt
    call DisplayMessage
    call TranslateBuffer
    mov  edx,OFFSET sDecrypt
    call DisplayMessage
    exit
main ENDP

    pushad
    mov edx,OFFSET sPrompt
    call WriteString
    mov ecx,BUFMAX
    mov edx,OFFSET buffer
    call ReadString
    mov bufSize,eax
    call Crlf
    popad
    ret
InputTheString ENDP

    pushad
    call WriteString
    mov edx, OFFSET buffer
    call WriteString
    call Crlf
    call Crlf
    popad
    ret
DisplayMessage ENDP

    pushad
    mov ecx,bufSize
    mov esi,0
L1:
    xor buffer[esi],Key
    inc esi
    loop L1
    popad
    ret

TranslateBuffer ENDP
END main


Hopefully I didn't fail to bad at life...

Name: Anonymous 2009-04-29 18:50

>>1
Hopefully I didn't fail to bad at life...
Oh yes you le did.

Name: Anonymous 2009-04-29 18:57

Sorry, what exactly are you asking?

Name: sage 2009-04-29 19:18

>>4
See >>2

Name: Anonymous 2009-04-29 19:26

Im trying to make an Encryption program,but I have no clue how to do this...

Name: Anonymous 2009-04-29 19:29

>>5
Then you really shouldn't be making an encryption program.

Name: Anonymous 2009-04-29 19:45

MASM

Name: Anonymous 2009-04-29 19:56

>>5
Why are you writing it in assembler?

Name: Anonymous 2009-04-29 20:55

>>8
Because WHBTC.

Name: Anonymous 2009-04-29 22:05

>>8
Because it's better than compiler.

Name: Anonymous 2009-04-29 22:29

>>8
Why not? Be adventurous. The best inventions came from people doing things unorthodox.

Name: Anonymous 2009-04-29 22:34

>>11
Your homework in assembly isn't very unorthodox.

Name: Anonymous 2009-04-29 22:49

>>12
On the contrary, my dear, it is very unorthodox, like rain on you're wedding day

Name: Anonymous 2009-04-30 2:59

Nevermind Anons. I know what I must do now.

My penis is in its final form.

Name: unorthodox 2009-04-30 9:26

unorthodox

Name: Anonymous 2010-12-17 1:40

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2013-01-19 14:30

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Name: Anonymous 2013-08-31 19:52


It was about Hikikomori as long as Misaki didn't show up.

Name: Anonymous 2013-08-31 21:23


Hey. I'm an american and i want to get news. I know CNN and FOX and all the crap that american's typicaly get is biased garbage. I dont trust BBC that much. What are some realiable new sources that i can look too.

Name: Anonymous 2013-09-01 19:55



I just got the limited edition Blu-ray collectors cut of Summer Wars.It came with a hanafuruda set using OZ characters,ehich was really neat but kind of useless since I don't play card games.The director's commentary disc was cool though.

Name: Anonymous 2013-09-01 20:42





    isent it great how we get to live in this country, that they use chemicals and medical procedure to enhance us for war?  Its cool that we get to be more enhanced then anywhere else in the world.

Don't change these.
Name: Email:
Entire Thread Thread List