arosspope / cipher-crypt

A cryptographic tomb of ciphers forgotten by time.
Apache License 2.0
42 stars 8 forks source link

Implement traits on the ciphers #5

Closed arosspope closed 7 years ago

dex-r commented 7 years ago

Looking at the current implementation of the traits, I was wondering whether the decrypt trait (and possibly encrypt) should return a Result<String> rather than just a String. Some of the ciphers listed in the readme will fail when trying to decrypt bad input e.g. The Baconian cipher will fail if the ciphertext length is not a multiple of 5. I guess an alternative would be to ignore parts of the ciphertext, but i think that's a bit presumptuous.

arosspope commented 7 years ago

I was thinking the same thing. Already there are some cases in some of the ciphers were certain cases should return an Err instead.

If you were so inclined could you create a seperate issue and implement result returns? 😊 If not, ill probably do it at some point

arosspope commented 7 years ago

See PR #7