All Questions
27 questions
0
votes
1
answer
85
views
Porting python aes ecb to php openssl
I have python code
from Crypto.Cipher import AES
def pad(data):
block_size = 16
bytes_to_add = block_size - ((len(data) % block_size) or block_size)
return data + (b'\0' * bytes_to_add)
...
0
votes
1
answer
133
views
what is key in CBC mode in `openssl genrsa -aes-128-cbc -passout pass:qwerty0123456789 -out private.pem 2048`?
I dont know the key in mode cbc, i tried write script python with expect it will return MIIE... but it doesnt
from base64 import b64decode, b64encode
from Crypto.Cipher import AES
data = "...
0
votes
0
answers
71
views
What are my options for implementing AES256 encryption on my embedded device running Linux 2.4.x without updating the OS?
The embedded device I use has no apt, dpkg etc. It still runs on linux 2.4.x. I need the OpenSSL extention for the terminal so that i can crypt files via AES256.
Sadly there is no possibility to ...
2
votes
1
answer
13k
views
Getting Data must be padded to 16 byte boundary in CBC mode when decrypting the file
I am trying to decrypt the file which I have encrypted using following link(python encryption code)
Getting Bad Magic Number while Decrypting the file
But when i am trying to decrypt the code getting ...
0
votes
1
answer
986
views
Getting Bad Magic Number while Decrypting the file
Here i am encrypting the file using below code using python and i am getting the encrypted file as expected.
from Crypto.Cipher import AES
import base64
def pad(s):
return s + b"\0" * (...
4
votes
1
answer
13k
views
AES-128 CBC encryption in python
I am trying to get rid of the openssl call below and replace it with pure python code.
import os
iv = "7bde5a0f3f39fd658efc45de143cbc94"
password = "...
1
vote
1
answer
1k
views
What is the openssl AES-CFB-128 command line equivalent to this python snippet?
I have this python snippet which always worked for me:
from Crypto.Cipher import AES # pip install pycryptodome
import os
def aes_cfb(data, key, iv):
ctx = AES.new(key, AES.MODE_CFB, iv = iv, ...
1
vote
1
answer
5k
views
bad decrypt when trying to decrypt a AES-CBC encrypted file using openssl
I'm trying to encrypt a file with python, like so:
import os
from binascii import hexlify
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
key = hexlify(os.urandom(16))
...
0
votes
1
answer
2k
views
Get Decryption key for aes 128 cbc without password for m3u8 video stream in Python
I have a video.ts file compiled by adding together a video stream in m3u8 format. I am trying to decrypt the video using the below statement.
subprocess.run(['openssl', 'aes-128-cbc','-K','[KEY]','-...
0
votes
1
answer
194
views
Recreating an openssl decrypt command in PyCrypto
I am trying to recreate the second command (decryption) in PyCrypto
openssl enc -aes-128-ecb -nosalt -base64 -pass pass:abcde -md sha256 -in test.txt -out out.txt
openssl enc -d -aes-128-ecb -nosalt -...
0
votes
0
answers
182
views
Is there a way decrypt OpenSSL AES-encrypted files in Python 3.x
I encrypted some files using openssl aes-256-cbc command in terminal
openssl aes-256-cbc -in filename.txt -out filename.enc -k password
Unfortunately I am unable to decrypt those files using Python ...
2
votes
0
answers
30
views
Decoding encrypted files in Python using AES [duplicate]
I have provided encrypted file, key and iv.
Using openssl I can do:
openssl aes-128-cbc-d -iv 8d8012a7ca3007dcf47e593f37681111 -K 20994d3521a087bcdbb870fc29653512 -in input_file -out output_file
Now ...
1
vote
0
answers
1k
views
PyCryptoDome generate OpenSSL PBKDF2 key for AES encryption
I want to encrypt a file using PyCryptoDome AES-256-ECB mode, write key and password to file and then decrypt it using OpenSSL
Python password and key encryption looks like this:
import random
import ...
0
votes
0
answers
178
views
Decrypt AES in PHP openssl from Python AES pycryptodomex
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s: s[:-ord(s[len(s) - 1:])]
base64pad = lambda s: s + '=' * (4 - len(s) % 4)
base64unpad = lambda s: s.rstrip("=")...
3
votes
4
answers
4k
views
Encode in Laravel, decode in Python
I'm using Laravel's encryptString method to encrypt some data on my website. This uses OpenSSL's 256-bit AES-CBC encryption without any serialization. I'm now trying to decrypt that data in Python but ...