python main.py arguments
you have to specify at least 3 arguments:
mode
this argument can be two values: encode
or decode
seed
this argument is the seed for the pseudo-random integers. you have to use the same seed for encoding/decoding! the longer this int is, the harder it will be to crack the code.
text to encrypt/decrypt
the text to encrypt/decrypt can take all arguments that are not file (in this repo always main.py
), mode, seed.
python main.py encode 352121898765432345123543212344388643234527 hello world
output:
^jkle'�wtua
(this output will always be the same, because random.randint()
isn't random)
in this case mode is encode
, seed is a very long number e.g. 352...... and text to encrypt takes the two last arguments, hello and world.
python main.py decode 352121898765432345123543212344388643234527 "^jkle'�wtua"
output:
hello world
(this output will also always be the same, because random.randint()
isn't random)
in this case mode is decode
, seed is the same number as used to encode and text to decrypt is the encrypted text, in this case: ^jkle'�wtua
.