Results 1 to 2 of 2
  1. #1
    samlarenskoog's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Posts
    104
    Reputation
    25
    Thanks
    57
    My Mood
    Cheerful

    Simple Encryption

    I have tried to encrypt a string using xor instruction.
    Code:
    .model tiny
    
    .code
    org 100h
    
    mov ah, 09h
    mov dx, offset msg
    int 21h
    
    xor msg, 00011000b
    
    mov ah, 09h
    mov dx, offset msg
    int 21h
    
    mov ah,4ch
    mov al,00
    int 21h
    
    
    .data
    msg db "Hello World $"
    I am using x86 asm with emu8086. It displays "Hello World Pello World". It only encrypts the first character. Why is this?

  2. #2
    nullptr_t's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    124
    Reputation
    10
    Thanks
    256
    Quote Originally Posted by samlarenskoog View Post
    I have tried to encrypt a string using xor instruction.
    Code:
    .model tiny
    
    .code
    org 100h
    
    mov ah, 09h
    mov dx, offset msg
    int 21h
    
    xor msg, 00011000b
    
    mov ah, 09h
    mov dx, offset msg
    int 21h
    
    mov ah,4ch
    mov al,00
    int 21h
    
    
    .data
    msg db "Hello World $"
    I am using x86 asm with emu8086. It displays "Hello World Pello World". It only encrypts the first character. Why is this?
    You need to create a loop for the XOR part.
    The reason why only first character is XORed is because the xor operator only works on one byte per operation.

    Zer0Mem0ry

    C/C++ Programmer, Youtuber, software enthusiast & hobbyist.

    Donate: (bitcoin): 1JhSKGgRQmir8rRF4Sm5CP4fDDofKFAypd

    Youtube: https://www.youtube.com/channel/UCDk...ariJF2Dn2j5WKA
    Skype: virtual_coder

Similar Threads

  1. [Tutorial] C++ Simple Encryption Algorithm XOR
    By nullptr_t in forum C++/C Programming
    Replies: 4
    Last Post: 11-01-2016, 03:24 PM
  2. [Tutorial] C++ XOR Encryption || Very simple encryption algorithm
    By ZER0MEM0RY in forum C++/C Programming
    Replies: 0
    Last Post: 07-13-2015, 06:19 AM
  3. [Source Code] Simple encrypt of words
    By Hacker Fail in forum C++/C Programming
    Replies: 0
    Last Post: 06-25-2014, 04:15 PM
  4. [Release] Flameswor10's Simple/Step Encryption Methods
    By flameswor10 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 22
    Last Post: 06-02-2012, 09:21 AM
  5. [Source Code] Simple Text Encryption
    By Defcon 1 in forum C++/C Programming
    Replies: 8
    Last Post: 11-16-2011, 04:30 PM