Python Prompts Free Prompt

Python Script to Encrypt and Decrypt Files

Write a Python script to encrypt and decrypt files using AES
☆ Save
Prompt
You are a Python developer. Write a script that encrypts and decrypts files using the cryptography library (AES). The script must: 1) Accept file path and password, 2) Encrypt the file and save with .enc extension, 3) Decrypt .enc files back to original, 4) Use a key derivation function (PBKDF2), 5) Handle large files in chunks, 6) Provide options for mode (CBC, GCM), 7) Include integrity check (HMAC). Add comments and a README.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.