.model small
.data
value db 'sanjay', '$'
v_size dw $-value
encrypt db 7 dup (?)
decrypt db 7 dup (?)
.code
begin:
mov ax, @data
mov ds, ax
mov es, ax
lea si, value
lea di, encrypt
mov cx, v_size
dec cx
mov ah, 09h
lea dx, valueint 21h
counter1:
mov ah, 0000h
mov al, [si]
add al, 01h
mov [di], al
inc di
inc si
loop counter1
mov [di], '$'
mov ah, 09h
lea dx, encrypt
int 21h
lea si, encrypt
lea di, decrypt
mov cx, v_size
dec cx
counter2:
mov ah, 0000h
mov al, [si]
sub al, 01h
mov [di], al
inc di
inc si
loop counter2
mov [di], '$'
mov ah, 09h
lea dx, decrypt
int 21h
.exit
end begin