arosspope / cipher-crypt

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

Cipher Implementation: Playfair #36

Closed glarsen closed 6 years ago

glarsen commented 6 years ago

Alrighty, Playfair here we go!

The cipher inputs (key, message) support the alpha [a-zA-Z] range of characters with no numbers, special characters, etc. Spaces are acceptable as they get removed internally. The encrypt/decrypt methods returns the message in uppercase without whitespace.

Note that given the manual nature of the cipher, the decrypt method can return strings that contain additional 'X' characters -- a side effect of the rule that removes repeated characters. I believe it is impossible to remove these characters programmatically if we are to keep the implementation stateless. Finally, note that any repeated characters in the key are removed (silently) per the spec for Playfair key generation.

I used the Playfair wikipedia page for reference.

Let me know what you think and thank you for starting this project!

glarsen commented 6 years ago

Thanks for the feedback @arosspope . I have made most of the changes you have requested. Once I clean up my commits I'll send the next set of changes.

arosspope commented 6 years ago

Let me know when you are ready for another review

glarsen commented 6 years ago

@arosspope I can't seem to recreate the rustfmt failures that TravisCI is identifying. When I run rustfmt --version I get 0.3.8-nightly (346238f 2018-02-04). I would assume that the TravisCI version is the same but I haven't identified the issue yet - any ideas?

Otherwise the code is ready for review.

arosspope commented 6 years ago

Hey @glarsen, sorry for the late review. I restarted a build on travis for your branch, and everything seems to have passed... probably some weird versioning issue caused the other build to fail.

glarsen commented 6 years ago

@arosspope The next iteration is ready for a review.

However, I may need to apply rustfmt to more than just the files that I changed before it will pass the TravisCI build. Do you want me to apply these formatting changes now in this PR?

arosspope commented 6 years ago

Yes, that would be good thanks. Once you've done that I'll merge 😊

glarsen commented 6 years ago

@arosspope done!