Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CFB and OFB modes of operation #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nikeee
Copy link
Contributor

@nikeee nikeee commented May 21, 2020

Like mentioned in #3 (comment), this PR tries to implement CFB and OFB modes.

You can use this for validation of the samples:

# CFB
echo "c0ldc0ffee" | python3 encrypt.py -e --iv 0123456789ABCDEF0123456789ABCDEF -m CFB examples/message.bin examples/ciphertext.10-check > /dev/null
echo "c0ldc0ffee" | python3 encrypt.py -d --iv 0123456789ABCDEF0123456789ABCDEF -m CFB examples/ciphertext.10-check examples/message.bin-check > /dev/null

sha256sum examples/message.bin examples/message.bin-check \
          examples/ciphertext.10-check examples/ciphertext.10

# OFB
echo "secret_key" | python3 encrypt.py -e --iv 0123456789ABCDEF0123456789ABCDEF -m OFB examples/message.bin examples/ciphertext.11-check > /dev/null
echo "secret_key" | python3 encrypt.py -d --iv 0123456789ABCDEF0123456789ABCDEF -m OFB examples/ciphertext.11-check examples/message.bin-check > /dev/null

sha256sum examples/message.bin examples/message.bin-check \
          examples/ciphertext.11-check examples/ciphertext.11

@mikepound
Copy link
Owner

Looking good - thanks :) It might take me a couple of days to take a proper look but i'll do it as soon as I can!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants