openGPMP
Open Source Mathematics Package
samples
python
rc4_ex.py
Go to the documentation of this file.
1
#!/usr/bin/python3
2
from
pygpmp
import
nt
3
4
5
def
main
():
6
print(
"Using the Number Theory module in Python"
)
7
print(
8
"Methods of the RC4 class:\n\
9
- byte_swap(a, b)\n\
10
- trad_swap(a, b)\n\
11
- XOR_swap(a, b)\n\
12
: swap functions ^\n\
13
\n\
14
- KSA(key, S, swap_type)\n\
15
: Key Swap Algorithm\n\
16
- PRGA(S, plaintext, ciphertext, swap_type)\n\
17
: Pseudo-Random Generation Algorithm\n\
18
\n\
19
- store_hash(plaintext, hashtext, swap_type)\n\
20
: stores hash to a value\n\
21
- compute(key, plaintext, hashtext, swap_type)\n\
22
: driver for RC4 algorithm\n"
23
)
24
25
r = nt.RC4()
26
27
28
if
__name__ ==
"__main__"
:
29
main
()
python.rc4_ex.main
def main()
Definition:
rc4_ex.py:5
Generated by
1.9.1