245,304
suntingan
(→Contoh) |
|||
== Contoh ==
Algorithm yang menggunakan, sebagai contoh, pemboleh ubah A dan B tetapi bukan pemboleh ubah C mampu kekal walaupun anda memasukkan banyak kod yang mengubah kandungan kepada pemboleh ubah C.
Algorithm asal:
Start:
GOTO Decryption_Code
Encrypted:
...
banyak kod dienkrip
...
Decryption_Code:
A = Encrypted
Loop:
B = *A
B = B XOR CryptoKey
*A = B
A = A + 1
GOTO Loop IF NOT A = Decryption_Code
GOTO Encrypted
CryptoKey:
some_random_number
Algorithm yang sama, tetapi dengan banyak perubahan kod C yang tidak diperlukan:
Start:
GOTO Decryption_Code
Encrypted:
...
lots of encrypted code
...
Decryption_Code:
C = C + 1
A = Encrypted
Loop:
B = *A
C = 3214 * A
B = B XOR CryptoKey
*A = B
C = 1
C = A + B
A = A + 1
GOTO Loop IF NOT A = Decryption_Code
C = C^2
GOTO Encrypted
CryptoKey:
nombor_rawak
== Rujukan ==
|