Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # Filename: view_salted.py
- # Version: 1.0.0
- # Author: Jeoi Reqi
- """
- This script provides a method to view the content of a salted & encrypted file without decrypting it.
- It is useful for users who need to inspect the raw encrypted data, including the salted portion, without decrypting the file.
- Requirements:
- - Python 3.x
- Usage:
- 1. Run the script.
- 2. Provide the path to the encrypted file when prompted.
- 3. The script will display the content of the encrypted file in the terminal, including the salted data.
- Important Notes:
- - This script does not decrypt the encrypted file. It only reads and displays the raw encrypted data.
- - Ensure that the file path provided is correct and points to a valid encrypted file.
- - The script assumes that the file is encrypted using a method that includes salting, such as AES-256-CBC encryption with salt and PBKDF2 key derivation.
- """
- import subprocess
- def view_encrypted_content(input_file):
- """
- View the content of a salted & encrypted file without decrypting it.
- """
- try:
- with open(input_file, "rb") as f:
- encrypted_data = f.read()
- print("\nEncrypted content:\n", encrypted_data)
- except FileNotFoundError:
- print("\nFile not found.\n")
- except Exception as e:
- print("\nAn error occurred:", e)
- # Example usage:
- input_file = "e.enc" # Replace this filename to match your encrypted filename
- view_encrypted_content(input_file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement