Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

How to des with zero padding #270

Open
hcaihao opened this issue Jul 14, 2018 · 0 comments
Open

How to des with zero padding #270

hcaihao opened this issue Jul 14, 2018 · 0 comments

Comments

@hcaihao
Copy link

hcaihao commented Jul 14, 2018

MODE_CBC need IV

obj = DES.new("money888", DES.MODE_ECB)
plain = pad("abc".encode('utf-8'), 8)
cipher = hexlify(obj.encrypt(plain))

output: "886283aa51bcdf72"

But with zero padding: "d02d2bb5bed5c8dc"

How to make compatible, thanks!

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

No branches or pull requests

1 participant