encryption

PermissionError: [Errno 13] Permission denied in a python program

PermissionError: [Errno 13] Permission denied in a python program Question: when I run my python program I encounter an error saying:PermissionError: [Errno 13] Permission denied and I do not know why it is not working I was wondering if i could somehow elevate myself when running this program. I am using vscode and I am …

Total answers: 1

Python AES encryption shows different result from originating C# code

Python AES encryption shows different result from originating C# code Question: The below code is my C# code for encryption using System; using System.IO; using System.Text; using System.Security.Cryptography; public static string Encrypt(string value) { byte[] bytes = Encoding.Unicode.GetBytes(value); Aes aes = Aes.Create(); Rfc2898DeriveBytes rfc2898DeriveBytes = new Rfc2898DeriveBytes("aaaabbbbccccddddffffeeee", new byte[13] { 73, 118, 97, 110, 32, …

Total answers: 1

Rust Decrypt from Python cryptography

Rust Decrypt from Python cryptography Question: I used cryptography to encrypt image file in Python. The code is here: import hashlib import base64 from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import padding import time key = "secretkey" keyBytes = hashlib.sha256(key.encode()).digest() ivBytes = b"xdaxe4x87xa7ix8arbOCxbd x02xbc*[" file_name = "1024.jpg" with open(file_name, "rb") …

Total answers: 2

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