encryption

Python Aes-256 GMC decrypt error at decode result

Python Aes-256 GMC decrypt error at decode result Question: I’m facing a issue to decrypt data that was encrypted in Node JS into python code: Error at "return decrypted.decode(‘utf-8’)" Error: ‘utf-8’ codec can’t decode byte 0xc8 in position 0: invalid continuation byte any idea why? import base64 from Crypto.Cipher import AES args = { "content": …

Total answers: 1

loss of data when decrypting a file in Python server from CPP client

loss of data when decrypting a file in Python server from CPP client Question: I am trying to send a file from a client written in CPP to a server written in Python. I am using AES encryption on client side to encrypt the file and then send it to the server, the AES key …

Total answers: 2

Pycryptodome incorrect decryption

Pycryptodome incorrect decryption Question: I am generating a RSA key pair in a django view, storing the keys in db, sending the public key to the client template, encrypting a message, then sending the message to a different view where I am retrieving the private key from the db and trying to decrypt the message. …

Total answers: 1

Encrypting java JWEObject with RSA in python

Encrypting java JWEObject with RSA in python Question: I asked a while ago how to do something similar: Decrypting and encrypting java JWEObject with algorithm RSA-OAEP-256 on python Now I have a different encryption key and that code is not working for me anymore. I need to be able to encrypt my data: {"value": "Object …

Total answers: 1

Python3 Pass parameters in the right order

Python3 Pass parameters in the right order Question: Firstly, I am unsure how to title this as I can’t think of how to even describe my issue. (let me know and I’ll update the title when I can) Well, What I am trying to do is make sure that the parameters being passed to a …

Total answers: 1

Error: the encoded message must be a list of integers

Error: the encoded message must be a list of integers Question: I am creating a prime encryption program however I am running into a very perplexing error. This is my code: import random import datetime def decode(encoded_message, p): # Initialize an empty list to store the decoded message decoded_message = [] # Iterate over the …

Total answers: 1

How to using sum function with encrypted column in SQLAlchemy?

How to using sum function with encrypted column in SQLAlchemy? Question: I have used EncryptedType from sqlalchemy_utils to encrypt data of the specific column which will make when inserting data into the table or selecting data, the data of encrypted column will be encrypted. This is the ORM structure of my database which have encrypted …

Total answers: 1

reimplementing crypto-js in python cryptography

reimplementing crypto-js in python cryptography Question: I want to implement the following code (written in JavaScript, using the crypto-js library) in Python (using the cryptography package) const data = ‘base 64 encoded encrypted data’; const salt = ‘XB7sHH26Hn&FmPLxnjGccKTfPV(yk’; const pass = ‘.. password ..’; const psw = `${PBKDF2(pass, salt)}(tXntTbJFzh]4EuQVmjzM9GXHCth8`; let data = AES.decrypt(data, psw).toString(enc.Utf8); Here’s …

Total answers: 1

How to use AES-CTR with same IV in Python?

How to use AES-CTR with same IV in Python? Question: With the pycryptodome library, when encrypting with AES-CTR, the iv keyword argument is unavailable for MODE_CTR. I tried setting nonce to 0, but the second ciphertext is still different from the first ciphertext. from Crypto.Cipher import AES key = ‘1111111111111111’ message = ‘Hello, world!’ cipher …

Total answers: 1

Python: Decrypting a file (have key)

Python: Decrypting a file (have key) Question: I encrypted a file from ascii randomized key. I need to decrypt back into normal letters from and then put that into a new file import random lst = list(range(1,128)) #for key numbersran = list() while len(numbersran) < 128: candidate = random.randint(1,128) if candidate not in numbersran: numbersran.append(candidate) …

Total answers: 2