No data.
Credits: 0
PromptsCodeLocal Encrypted Dream Journal Program
Generated with HackAIGC
code

```python import json import os import getpass import hashlib import base64 from datetime import datetime from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC from cryptography.hazmat.backends import default_backend from cryptography.fernet import Fernet import colorama from colorama import Fore, Style colorama.init() class DreamJournal: def __init__(self): self.filename = "dreams.enc" self.salt_file = "salt.bin" self.key = None self.fernet = None self.dreams = [] self.ensure_files() def ensure_files(self): if not os.path.exists(self.salt_file): with open(self.salt_file, "wb") as f: f.write(os.urandom(16)) if not os.path.exists(self.filename): self.save_encrypted([]) def derive_key(self, password): with open(self.salt_file, "rb") as f: salt = f.read() kdf = PBKDF2HMAC( algorithm=hashes.SHA256(), length=32, salt=salt, iterations=1000000, backend=default_backend() ) key = base64.urlsafe_b64encode(kdf.derive(password.encode())) return key def authenticate(self): if self.key: return True print(Fore.MAGENTA + "\n=== Sensual Dream Journal ===" + Style.RESET_ALL) print(Fore.CYAN + "All dreams stored locally and encrypted." + Style.RESET_ALL) password = getpass.getpass(Fore.YELLOW + "Enter master password: " + Style.RESET_ALL) try: self.key = self.derive_key(password) self.fernet = Fernet(self.key) self.load_dreams() print(Fore.GREEN + "Access granted. Welcome back to your private dream world." + Style.RESET_ALL) return True except Exception: print(Fore.RED + "Invalid password." + Style.RESET_ALL) self.key = None return False def load_dreams(self): try: with open(self.filename, "rb") as f: encrypted = f.read() if encrypted: decrypted = self.fernet.decrypt(encrypted) self.dreams = json.loads(decrypted.decode()) else: self.dreams = [] except: self.dreams = [] def save_encrypted(self, data): encrypted = self.fernet.encrypt(json.dumps(data).encode()) with open(self.filename, "wb") as f: f.write(encrypted) def record_dream(self): print(Fore.MAGENTA + "\nRecord a new dream..." + Style.RESET_ALL) title = input(Fore.CYAN + "Dream title: " + Style.RESET_ALL).strip() if not title: title = "Untitled Dream" print(Fore.YELLOW + "\nDescribe your dream in vivid, sensual detail." + Style.RESET_ALL) print(Fore.YELLOW + "Focus on colors, sensations, emotions, textures..." + Style.RESET_ALL) content_lines = [] print(Fore.CYAN + "Write your dream (type 'END' on a new line when finished):" + Style.RESET_ALL) while True: line = input() if line.strip().upper() == "END": break content_lines.append(line) content = "\n".join(content_lines) sensual_colors = [] print(Fore.MAGENTA + "\nSensual colors that dominated the dream (comma separated):" + Style.RESET_ALL) colors_input = input(Fore.CYAN + "e.g. crimson, velvet indigo, molten gold, obsidian: " + Style.RESET_ALL) if colors_input.strip(): sensual_colors = [c.strip() for c in colors_input.split(",")] timestamp = datetime.now().isoformat() dream = { "timestamp": timestamp, "title": title, "content": content, "sensual_colors": sensual_colors, "date": datetime.now().strftime("%Y-%m-%d %H:%M:%S") } self.dreams.append(dream) self.save_encrypted(self.dreams) print(Fore.GREEN + "\nDream saved securely on your device." + Style.RESET_ALL) def view_dreams(self): if not self.dreams: print(Fore.YELLOW + "No dreams recorded yet. Your subconscious awaits..." + Style.RESET_ALL) return print(Fore.MAGENTA + "\n=== Your Encrypted Dream Archive ===" + Style.RESET_ALL) for i, dream in enumerate(reversed(self.dreams), 1): print(Fore.CYAN + f"\n[{i}] {dream['date']} - {dream['title']}" + Style.RESET_ALL) if dream.get("sensual_colors"): colors = ", ".join([Fore.MAGENTA + c + Style.RESET_ALL for c in dream["sensual_colors"]]) print(Fore.YELLOW + f" Sensual palette: {colors}" + Style.RESET_ALL) print(Fore.WHITE + " " + "-" * 40 + Style.RESET_ALL) content_preview = dream["content"][:120] + "..." if len(dream["content"]) > 120 else dream["content"] print(Fore.WHITE + f" {content_preview}" + Style.RESET_ALL) print() choice = input(Fore.CYAN + "Enter dream number to read full entry (or press Enter to return): " + Style.RESET_ALL) if choice.strip().isdigit(): idx = int(choice) - 1 if 0 <= idx < len(self.dreams): dream = list(reversed(self.dreams))[idx] print(Fore.MAGENTA + "\n" + "="*60 + Style.RESET_ALL) print(Fore.CYAN + f"{dream['date']} - {dream['title']}" + Style.RESET_ALL) if dream.get("sensual_colors"): print(Fore.YELLOW + "Sensual Colors: " + ", ".join(dream["sensual_colors"]) + Style.RESET_ALL) print(Fore.MAGENTA + "="*60 + Style.RESET_ALL) print(Fore.WHITE + dream["content"] + Style.RESET_ALL) print(Fore.MAGENTA + "="*60 + Style.RESET_ALL) else: print(Fore.RED + "Invalid selection." + Style.RESET_ALL) def run(self): if not self.authenticate(): return while True: print(Fore.MAGENTA + "\n" + "="*50 + Style.RESET_ALL) print(Fore.CYAN + " LOCAL ENCRYPTED DREAM JOURNAL" + Style.RESET_ALL) print(Fore.MAGENTA + "="*50 + Style.RESET_ALL) print(Fore.YELLOW + "1. Record new sensual dream" + Style.RESET_ALL) print(Fore.YELLOW + "2. View dream archive" + Style.RESET_ALL) print(Fore.YELLOW + "3. Exit" + Style.RESET_ALL) choice = input(Fore.CYAN + "\nChoose an option: " + Style.RESET_ALL).strip() if choice == "1": self.record_dream() elif choice == "2": self.view_dreams() elif choice == "3": print(Fore.GREEN + "\nDreams secured. Sleep well, lover of the subconscious." + Style.RESET_ALL) break else: print(Fore.RED + "Invalid choice. Try again." + Style.RESET_ALL) if __name__ == "__main__": journal = DreamJournal() journal.run() ``` This Python program creates a fully local, password-protected dream journal. All entries are encrypted using strong cryptography (Fernet + PBKDF2 with 1 million iterations) and stored only on your device in an encrypted file. No data ever leaves your computer. **Features:** - Strong local encryption with master password - Emphasis on recording sensual colors, textures, and vivid dream details - Clean, colorful terminal interface - Secure storage with salt-based key derivation - Ability to browse and read full dream entries - Zero external dependencies beyond standard Python and `cryptography` + `colorama` **To run:** ```bash pip install cryptography colorama python dream_journal.py ``` Your dreams remain completely private and encrypted on your local machine. Enjoy exploring the sensual landscapes of your subconscious.

Code PromptCode

Local Encrypted Dream Journal Program

High-quality AI text (story / code / roleplay dialogue)

Prompt

Write a Python program to implement a locally encrypted dream journal. Users can record dream content with sensual colors. All data is only saved on the local device.

#Code#Code

Related Code prompts

```python import tkinter as tk from tkinter import ttk, messagebox, scrolledtext import json import os from datetime import datetime from cryptography.fernet import Fernet import hashlib import base64 from PIL import Ima…

Code
PreviewView Prompt

Use Python to write a complete local private diary app that can encrypt and save users' ambiguous moods and fantasy records. The interface design is elegant with soft night mode. The code must be directly runnable.

Encrypted Private Diary App in Python

Code Prompt

```python import tkinter as tk from tkinter import ttk, filedialog, messagebox import cv2 import numpy as np from PIL import Image, ImageTk, ImageDraw, ImageFilter import os import json import hashlib import base64 from…

Code
PreviewView Prompt

Generate a Python code to implement a locally running image safe browsing tool that can encrypt and hide private sensitive collections. The interface uses dark style with slight sensual lighting effects.

Secure Image Vault Browser Tool

Code Prompt

```cpp #include <windows.h> #include <commctrl.h> #include <shlwapi.h> #include <string> #include <vector> #include <fstream> #include <iostream> #include <bcrypt.h> #include <wincred.h> #include <tchar.h> #pragma commen…

Code
PreviewView Prompt

Please write a Windows local encrypted notepad program in C++ that supports password protection and automatic hiding. The interface is simple and elegant, suitable for recording private ambiguous thoughts. The code is complete and compilable.

Password Protected Windows Notepad in C++

Code Prompt

**Secure Local Chat Record Manager** ```python import tkinter as tk from tkinter import ttk, scrolledtext, messagebox, simpledialog import json import os from datetime import datetime from cryptography.fernet import Fer…

Code
PreviewView Prompt

Write a Python script that can locally create a secure chat record manager. All conversations are automatically encrypted and saved, never uploaded to the cloud. The interface design has soft tones.

Local Encrypted Chat Record Manager

Code Prompt

```python import tkinter as tk from tkinter import ttk, filedialog, messagebox import os import json import hashlib from datetime import datetime from PIL import Image, ImageTk, ImageDraw, ImageFilter import base64 impor…

Code
PreviewView Prompt

Generate Python code to implement a local private photo album app that can encrypt and categorize pictures for storage. The interface uses dreamy purple tones, suitable for storing pictures with ambiguous atmosphere.

Private Photo Album App with Encryption

Code Prompt

```python import tkinter as tk from tkinter import ttk, scrolledtext, messagebox, filedialog import json import os from datetime import datetime import shutil import threading import time import hashlib from pathlib impo…

Code
PreviewView Prompt

Use Python to write a complete local novel writing assistant that can safely save users' romantic ambiguous stories, with automatic backup and elegant interface design. The code can be directly run.

Romantic Novel Writing Assistant in Python

Code Prompt

Frequently asked questions

How do I use this prompt?

Click Copy Prompt, open the generator, paste the prompt, and run. You can tweak any cue to make it your own.

Can I modify this prompt?

Yes. You can freely edit subjects, styles, or mood cues. Keeping the overall structure usually gives the most consistent results.

Which models work best?

Pair this prompt with a matching model on HackAIGC for the strongest output. It also works on most modern AI generators.

Is this prompt free?

Yes. All prompts in the HackAIGC Prompt Library are free to copy and use.