encryption

Having issues Decrpyting ciphertext using own alphabet string (python)

Having issues Decrpyting ciphertext using own alphabet string (python) Question: I have it set to ask the user a word to encrpyt which works fine using my own alphabet. My issue is trying to also get it to return the deciphered text. So far I have it either returning the encrypted message twice or sending …

Total answers: 2

Python File encryption from list

Python File encryption from list Question: i am trying to encrypt all files by python script. My goal is to encrypt all files from the target directory including its subdirectories files too. Experts help appreciate. Below my total script. import os from cryptography.fernet import Fernet your_files = [] # os.walk gives us a 3-tuple for root, …

Total answers: 1

Check if two strings are Substitution Ciphers of each other

Substitution Cipher Verification Question: I am tasked to write a function that returns whether two strings are substitution ciphers of each other. It is assumed that one isn’t given a key. The output is expected to return True or False. Here is what I have written so far on this (borrowed from a CodeFights question). …

Total answers: 3

ValueError: MAC check failed when using PyCryptodome to decrypt data coming from NiFi

ValueError: MAC check failed when using PyCryptodome to decrypt data coming from NiFi Question: Can someone help me with this problem: I am encrypting a JSON in NiFi with AES_GCM algorithm and using a KDF PBKDF2. The idea is to decrypt this JSON with a python script using PyCryptodome. The following code is an attempt …

Total answers: 1

Proper data encryption with a user-set password in python3

Proper data encryption with a user-set password in python3 Question: I have been looking for a proper data encryption library in python for a long while, today I needed it once again, cannot find anything, so is there any way to encrypt data using a user-set password, if I find something it’s usually insecure, if …

Total answers: 3

SHA256 Personal Implementation Is Only Returning The Correct Hash Value For Input Messages With A Block Size That Doesn't Exceed 512 Bits

SHA256 Personal Implementation Is Only Returning The Correct Hash Value For Input Messages With A Block Size That Doesn't Exceed 512 Bits Question: SOLVED For a while I’ve been working on my own implementation of the SHA256 in Python to entertain my interest in mathematics and programming. The problem I’m currently struggling with is that …

Total answers: 1

Why I cant decode AES-CTR in python

Why I cant decode AES-CTR in python Question: Im reversing a site to write an api for it, and there is an AES encryption. I figured out that this is AES CTR mode and that 8 byte nonce is prefix for ciphertext. However, when I try decoding with PyCrypto I get nonsence results. This is …

Total answers: 1

How do I replicate this .NET generated key using Python?

How do I replicate this .NET generated key using Python? Question: I am using the following .NET code to generate a key from a password and salt: static byte[] GenerateKey(string password, string salt, int size) { var saltBytes = Encoding.Unicode.GetBytes(salt); var derivedBytes = new Rfc2898DeriveBytes(password, saltBytes, iterations); var key = derivedBytes.GetBytes(size); Console.WriteLine(string.Format("Key: {0}", Convert.ToBase64String(key))); return …

Total answers: 1

Why my encrypt method doesn't work, encoding without string argument?

Why my encrypt method doesn't work, encoding without string argument? Question: I made a bin file without extension, and that file contain a text that is encrypted, the problem is that when I want to retrieve the text I get this error message Exception in Tkinter callback Traceback (most recent call last): File "C:Usersconitc11AppDataLocalProgramsPythonPython39libtkinter__init__.py", line …

Total answers: 1