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.8

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.8.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.8-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: huawuque_cryptool-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 4010b9ef6f29a4ece2f69994663ff316278958043e21eee3927a01d8693777ec
MD5 f16df5c5d6b41b0d467c528b77e816d5
BLAKE2b-256 0259593bc3150ecd6993458149b7611942097b4af44dd83b57178f88adbe3213

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for huawuque_cryptool-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 034040733174f90c71aa8f3da0f57edb537482cce725e41f6b1c58d89c735ddb
MD5 ab222547d2d2f82340678e26e5526211
BLAKE2b-256 bfcdfb4b20ffe46d5ce7da57ddca530984bc37f0d9e2d5c1d8e79368c191e7ec

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