I do not have a real result about encryption file use AES mode CFB in pycrptodome on python [closed]

0 votes
I'm using Ubuntu win. on python I want to encrypt file by use AES mode CFB in pycryptodome but the result I have is encryption the path as txt file on the real path of the file?

>>> import os
>>> import math
>>> import hashlib
>>> import json
>>> from Crypto.Cipher import AES
>>> from Crypto import Random
>>> from Crypto.Random import get_random_bytes
>>> from base64 import b64encode, b64decode
#######################################
>>> key = get_random_bytes(32)
>>> data = 'path_of_file.json'
>>> datanew = data.encode('utf-8')
>>> cipher = AES.new(key, AES.MODE_CFB)
>>> cipher_datanew = cipher.encrypt(datanew)
>>> iv = b64encode(cipher.iv).decode('utf-8')
>>> ct = b64encode(cipher_datanew).decode('utf-8')
>>> result = json.dumps({'iv':iv, 'ciphertext':ct})
>>> print(result)

{"ciphertext": "3s1bIOPwYAMCQxwcdmQ910mxeEiizD64LAZeP0eVQM0P8Mm6", "iv": "MtIYXOP2Z23jpukldmSNXA=="}
closed with the note: i have the solution
Aug 22 in Cyber Security & Ethical Hacking by Ahmed
• 260 points

closed Aug 22 by Ahmed 11 views

Related Questions In Cyber Security & Ethical Hacking

0 votes
1 answer

Not able to use nmap in python.

nmap module doesn’t have PortScanner attribute. The ...READ MORE

answered Jan 28 in Cyber Security & Ethical Hacking by Omkar
• 67,520 points
69 views
0 votes
1 answer

Not able to run nmap scan on router.

Might not be the actual router address. ...READ MORE

answered Jan 31 in Cyber Security & Ethical Hacking by Omkar
• 67,520 points
78 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Not able to run nikto scan on nikto-test.com

Hi, the webpage nikto-test.com doesn’t exist anymore. ...READ MORE

answered Apr 1 in Cyber Security & Ethical Hacking by Karan

reshown Apr 1 by Omkar 41 views
0 votes
1 answer
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 238 views