# caesar-python **Repository Path**: renjiangyang/caesar-python ## Basic Information - **Project Name**: caesar-python - **Description**: No description available - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-25 - **Last Updated**: 2026-02-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Caesar Cipher Python Python 实现的凯撒密码(Caesar Cipher)加密解密工具。 ## 简介 凯撒密码是一种古老且简单的替换加密技术,它通过将字母表中的每个字母替换为固定偏移位置的字母来实现加密。本项目提供了凯撒密码的 Python 实现,支持加密和解密功能。 ## 功能特性 - 字母加密:支持对英文字母进行凯撒密码加密 - 字母解密:支持对加密后的凯撒密码进行解密 - 偏移量可配置:用户可以自定义偏移量(1-25) - 保留非字母字符:标点符号、数字等非字母字符保持不变 ## 安装 ```bash pip install caesar-python ``` ## 使用方法 ```python from caesar import caesar_encrypt, caesar_decrypt # 加密 plaintext = "Hello, World!" shift = 3 ciphertext = caesar_encrypt(plaintext, shift) print(f"加密结果: {ciphertext}") # 输出: Khoor, Zruog! # 解密 decrypted = caesar_decrypt(ciphertext, shift) print(f"解密结果: {decrypted}") # 输出: Hello, World! ``` ## 命令行使用 ```bash # 加密 python -m caesar encrypt "Hello, World!" 3 # 解密 python -m caesar decrypt "Khoor, Zruog!" 3 ``` ## 许可证 MIT License