Answer the question
In order to leave comments, you need to log in
How to make CryptoJS decrypt what PyCrypto encrypts?
Good afternoon. Since no one answered my previous question (probably because of its cumbersomeness), I will try to reformulate it very clearly.
So, the task: on your own (without ssl) to organize the transfer of encrypted messages between the server (python) and the client (javascript).
Problem: I can't seem to get CryptoJS to decrypt what PyCrypto encrypts. Probably due to my handicap from birth.
So, what I have already done:
1. Tried all possible encryption modes on both sides. As a result, I came to the conclusion that ECB is an ideal option.
2. Encoded / decoded the result in base64 (for transfer).
3. Furiously buggered about the multiplicity of everything and everything 16. As a result, I googled and riveted this:
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question