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

Suggestion: implement ciphertext stealing (CTS) for ECB and CBC #1

Open
prusnak opened this issue Jun 7, 2014 · 3 comments
Open

Suggestion: implement ciphertext stealing (CTS) for ECB and CBC #1

prusnak opened this issue Jun 7, 2014 · 3 comments

Comments

@prusnak
Copy link

prusnak commented Jun 7, 2014

There is a method called ciphertext stealing (https://en.wikipedia.org/wiki/Ciphertext_stealing) which allows encryption of plaintext of artibrary length (the length does not have to be a multiply of blocksize) using ECB and CBC.

I see three ways how this can be integrated into the existing code:
a) add enable_cts=False parameter to constructors of AESModeOfOperationECB and AESModeOfOperationCBC, store the value in class and handle encryption/decryption with respect to this value
b) always perform CTS when len(plaintext) % blocksize > 0 or len(ciphertext) % blocksize > 0
c) create separate classes AESModeOfOperationECBCTS and AESModeOfOperationCBCCTS

Btw. Thanks for the library! Exactly what I was looking for after I realised that slowaes is dead. And your provide much more pleasant API. Thumbs up!

@ricmoo
Copy link
Owner

ricmoo commented Jun 7, 2014

Awesome! I will look into it and hopefully get it done this week.

I will probably do the (b) method... But I have to research first. :)

Thanks a lot!

RicMoo

@ricmoo
Copy link
Owner

ricmoo commented Jun 8, 2014

Oh sorry. Misread the email. I meant option (c).

@ricmoo
Copy link
Owner

ricmoo commented Jun 1, 2016

We now have an optional parameter to specify padding options, so I will likely just add a PADDING_CTS in the non-distant future. If anyone wants this functionality soon-than-later, please +1 this issue. :)

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

No branches or pull requests

2 participants