dyne / tomb

the Crypto Undertaker
https://dyne.org/software/tomb
GNU General Public License v3.0
1.32k stars 150 forks source link

Uncloak fails when using extras/cloak/ciphers/starTrek #522

Open 68420948 opened 1 month ago

68420948 commented 1 month ago

The cipher extras/cloak/ciphers/starTrek contains trailing whitespace (tabstops) causing 'tomb uncloak ...' to fail like this:

~~ Cloak a key file ...
+ echo ~~ Cloak a key file ...
+ /usr/bin/tomb cloak -k argon2-test.key extras/cloak/ciphers/starTrek cloaked_key.txt
tomb  .  Key is valid.
tomb (*) Encoding key argon2-test.key using cipher extras/cloak/ciphers/starTrek
tomb (*) Tomb key encoded succesfully
~~ Uncloak and verify a key file ...
+ echo ~~ Uncloak and verify a key file ...
+ /usr/bin/tomb uncloak cloaked_key.txt extras/cloak/ciphers/starTrek uncloaked.key
Traceback (most recent call last):
  File "/usr/libexec/tomb/decloakify", line 84, in <module>
    Decloakify(args.input, args.cipher, args.output, args.password)
  File "/usr/libexec/tomb/decloakify", line 66, in Decloakify
    clear64 +=  array64[arrayCipher.index(line)]
                        ^^^^^^^^^^^^^^^^^^^^^^^
ValueError: 'Daniels\n' is not in list
tomb [W] Nothing found in cloaked_key.txt