Skip to main content

A comprehensive encryption tool with GUI and CLI interfaces

Project description

加密工具 (CryptoTool)

这是一个基于Python的加密工具,提供了多种加密算法的实现,包括AES对称加密、RSA非对称加密以及混合加密方案。

功能特点

  • AES对称加密/解密
  • RSA非对称加密/解密
  • 混合加密方案(AES + RSA)
  • 文件加密/解密支持
  • 完整的错误处理和日志记录
  • 支持命令行操作

系统要求

  • Python 3.6 或更高版本
  • MySQL 数据库(用于密钥存储)
  • 对于 GUI 功能,需要安装 tkinter(Python 标准库的一部分)

安装步骤

1. 安装系统依赖

Windows

# 安装 MySQL
# 从 https://dev.mysql.com/downloads/installer/ 下载并安装 MySQL

# 安装 Python
# 从 https://www.python.org/downloads/ 下载并安装 Python 3.6+

Linux (Ubuntu/Debian)

# 安装 MySQL
sudo apt-get update
sudo apt-get install mysql-server

# 安装 Python 和 tkinter
sudo apt-get install python3 python3-tk python3-pip

macOS

# 使用 Homebrew 安装 MySQL
brew install mysql

# 安装 Python(通常已预装)
# 如果需要安装 tkinter
brew install python-tk

2. 配置 MySQL

# 登录 MySQL
mysql -u root -p

# 创建数据库
CREATE DATABASE crypto_keystore;

# 创建用户并授权
CREATE USER 'your_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON crypto_keystore.* TO 'your_user'@'localhost';
FLUSH PRIVILEGES;

3. 安装 Python 包

# 安装加密工具
pip install huawuque-cryptool==0.1.9

4. 配置环境

  1. 创建项目目录:
mkdir my_crypto_project
cd my_crypto_project
  1. 创建 .env 文件:
# 数据库配置
DB_HOST=localhost
DB_USER=your_user
DB_PASSWORD=your_password
DB_NAME=crypto_keystore
DB_PORT=3306

# 主密钥(用于加密存储的敏感信息)
MASTER_KEY=your_master_key

# 日志配置(可选)
LOG_LEVEL=INFO
LOG_FILE=logs/crypto.log
  1. 初始化数据库:
# 运行初始化脚本
python -m cryptool.utils.setup_db

使用方法

命令行使用

# 查看帮助
cryptool --help

# 加密文件
cryptool encrypt --file test.txt --algorithm aes

# 解密文件
cryptool decrypt --file test.txt.enc --algorithm aes

# 生成密钥
cryptool generate-key --algorithm rsa

图形界面使用

# 启动图形界面
cryptool-gui

依赖说明

项目依赖以下 Python 包:

  • python-dotenv>=1.0.0:用于环境变量管理
  • cryptography>=41.0.0:用于加密操作
  • python-docx==0.8.11:用于处理 Word 文档
  • docx2txt==0.8:用于从 Word 文档提取文本
  • pycryptodome>=3.18.0:用于加密操作
  • mysql-connector-python>=8.0.0:用于 MySQL 数据库连接
  • psutil>=5.9.0:用于系统资源监控

注意事项

  1. 确保 .env 文件中的配置正确
  2. 主密钥要妥善保管,不要泄露
  3. 加密后的文件要安全存储
  4. 定期备份数据库
  5. 定期轮换密钥
  6. 不要将包含敏感信息的文件提交到版本控制系统

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

huawuque_cryptool-0.1.9.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

huawuque_cryptool-0.1.9-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

Details for the file huawuque_cryptool-0.1.9.tar.gz.

File metadata

  • Download URL: huawuque_cryptool-0.1.9.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for huawuque_cryptool-0.1.9.tar.gz
Algorithm Hash digest
SHA256 17083f3188a4891dbf434b13418b9ce61aba0b9a80712a6113cdbba02efacdc5
MD5 b803381153924ffae7b3ef9c0e262338
BLAKE2b-256 598db082d89dd0ce3677a5e5c5cc4e96096e61f0a43416598e8a776e0c174439

See more details on using hashes here.

File details

Details for the file huawuque_cryptool-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for huawuque_cryptool-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 cce65dab4b1b0ce0bd17b46c254024fd1ed26d9b4b9032e522ece3e63bc350d6
MD5 00db59decc4b65205c357564021545d7
BLAKE2b-256 908dcc3a54092a0079747900da9c08e28d05618b56e74774e34d8e5529ca0c15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page