-
Notifications
You must be signed in to change notification settings - Fork 85
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
How (is it possible) to decrypte in Pytyhon? #141
Comments
Struggling with the same thing using PyNaCL. Below is how far (or "not far") I got.
All I'm getting from this is a I think I'm stumbling over the 2nd parameter of Update: Looking into the code of the Symmetric Crypto class I an unpacking of the 'MUIEA…' string happens to extract the actually encrypted value, nonce, etc. — Will look into that … |
When manually calling the $decoder = \ParagonIE\Halite\Halite::chooseEncoder(\ParagonIE\Halite\Halite::ENCODE_BASE64URLSAFE, true);
$parts = \ParagonIE\Halite\Symmetric\Crypto::unpackMessageForDecryption($decoder('MUIEA…'));
$nonce = $parts[3];
$encrypted = $parts[4]; I've recreated this functionality in the Python code based upon its logic: nonce = nacl.encoding.URLSafeBase64Encoder.decode(encrypted_value)[36:60] # start at 36, length of 24
encrypted = nacl.encoding.URLSafeBase64Encoder.decode(encrypted_value)[60:len(string)-112] # start at 60, length of 112 (not 124 as mentioned in the Halite source?!) When comparing the base64 encoded values of both the PHP and the Python Think I am close, but am still missing a part … |
I placed a question at StackOverflow on how to Decrypt in Python a string encrypted in PHP with Halite/Libsodium, but I was wondering if it is ever possible...
If so, can you put me in the right direction?
The text was updated successfully, but these errors were encountered: