Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Encrypt and decrypt txt file

How can i do Encrypt and decrypt txt file With Python programming ?
depends on what you need it for.
you can just encode it to base64 or you can use https://pypi.python.org/pypi/pycrypto/2.6.1
[Image: bitcoin.png] Be Nice For Once 15hVUVz7xA4kazHdk2BuErENGCskVwjYXP
(Jan 11, 2018 05:15 AM)HFDone Wrote:  depends on what you need it for.
you can just encode it to base64 or you can use https://pypi.python.org/pypi/pycrypto/2.6.1

Base64 is encoding, not encryption.
[Image: 4YPLYme.gif]

(Jan 11, 2018 05:16 AM)Payload Wrote:  Base64 is encoding, not encryption.

try to read it again and you should see why your reply is stupid  ❓
[Image: bitcoin.png] Be Nice For Once 15hVUVz7xA4kazHdk2BuErENGCskVwjYXP
I want for txt file !!!!!!!!!!!!!!!
(Jan 11, 2018 10:15 AM)iboyhacker_1997 Wrote:  I want for txt file !!!!!!!!!!!!!!!

There have been suggestions on how to encrypt a text file. If you want someone to write code for you, then ask. You’ve been suggested to use a module for encryption by another user, albeit for outdated python 2.6.

Here is documentation showing how to use the module PyCryptodome (works for Python 3.1) to encrypt text.
https://www.pycryptodome.org/en/latest/s...a-with-aes

Heres a quick algorithm to help you out.

1. Read the text from the file into a variable
2. Run the string through an encryption module
3. Overwrite the original text file data with the encrypted string variable
(Jan 11, 2018 05:16 AM)Payload Wrote:  Base64 is encoding, not encryption.

kid learn to read you think i care about rep  🤣 i will report you for fake rep  😉 im here from 2010 and knows about coding much more then you and the others kids here.
Edit - report you for lying
[Image: bitcoin.png] Be Nice For Once 15hVUVz7xA4kazHdk2BuErENGCskVwjYXP
If you want some code, (rather than arguments), here you go:

Code
def encrypt(par1):
    #run some sort of encryption here and return it

file_to_encrypt = open("test.txt", "wb")
file_to_encrypt.write(bytes(encrypt(file_to_encrypt.read()), 'UTF-8'))

Something like that.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by MarwenSep 24, 2022 04:19 PM 10 638 Sep 24, 2022 04:19 PM
Last Post: BinaryFox
[Shell] by Cyber "Max" ShamanJan 25, 2022 08:56 PM 3 184 Jan 25, 2022 08:56 PM
Last Post: Cyber "Max" Shaman
[Shell] by ImmortalJul 10, 2021 07:24 AM 3 239 Jul 10, 2021 07:24 AM
Last Post: Exalted