I want to write the TEA algorithm in assembly 8086 (TASM), and I am stuck in the first steps of splitting the plaintext (the block ) variable into 2 variables and the key into 4 variables (k1, k2, k3, k4).
I know the limit of the plaintext (block) is 64 bits (8 bytes)
and the limit of the key is 128 bits (16 bits).
The plaintext variable is stored in the ds:
plainText db 8 dup('$')
this is the two variables of the plaintext:
p1 db 4 dup('$')
p2 db 4 dup('$')
The key variable is stored like this:
key db 16 dup("$")
macro inputString storage
pusha
mov ah, 0ah
lea dx, storage
int 21h
popa
endm inputString
and the 4 split keys:
k0 db ?
k1 db ?
k2 db ?
k3 db ?
this is my currently encryption section for taking the input from the user:
proc encryptionSelection
print plainTextPrompt
inputString [plainText] ; Block Limit: 64 bits -> 8 bytes
call printLine
print p1
call printLine
print p2
print keyPrompt
inputString [key] ; Key Limit: 128 bits -> 16 bytes
; Encryption Logic Here...
ret
endp encryptionSelection
macro inputString storage
pusha
mov ah, 0ah
lea dx, storage
int 21h
popa
endm inputString
macro print value
pusha
mov ah, 09h
mov dx, offset value
int 21h
popa
endm print
I tried many ways and gogled a lot, but I couldn’t find any solutions.