-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCrypto.cbl
32 lines (23 loc) · 1018 Bytes
/
Crypto.cbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Identification Division.
Program-Id. CRYPTO.
Author. RONALDO OTTONI.
Data Division.
Working-Storage Section.
01 Cripto.
05 BYTE-SENHA PIC 9(02) COMP-X OCCURS 10.
01 Counter PIC 9(02) Value Zeros.
Procedure Division.
Display "Encriptando a palavra Teste"
Move "Teste" To Cripto
Perform Varying Counter From 1 By 1 Until Counter > 10
Add 5 To Byte-Senha(Counter)
Add Counter To Byte-Senha(Counter)
End-Perform
Display "Palavra Encriptada: " Cripto.
Move zeros to Counter
Perform Varying Counter From 1 By 1 Until Counter > 10
Subtract 5 From Byte-Senha(Counter)
Subtract Counter From Byte-Senha(Counter)
End-Perform
Display "Palavra Decriptada: " Cripto.
Stop Run.