Python_字符串简单加密解密
2024-08-29 05:24:14
def crypt(source,key):
from itertools import cycle
result=''
temp=cycle(key)
for ch in source:
result=result+chr(ord(ch)^ord(next(temp)))
return result source='Jiangxi Insstitute of Busiess and Technology'
key='zWrite' print('Before Encrypted:'+source)
encrypted=crypt(source,key)
print('After Encrypted:'+encrypted)
decrypted=crypt(encrypted,key)
print('After Decrypted:'+decrypted)
# Before Encrypted:Jiangxi Insstitute of Busiess and Technology
# After Encrypted:0>w;>Z8I6 >E9I ?
# .
# After Decrypted:Jiangxi Insstitute of Busiess and Technology
最新文章
- Elasticsearch推荐插件篇(head,sense,marvel)
- ionic的scroll的使用出现的问题
- [基础常识]阿里云ecs从购买到环境搭建和建站!!(phpstudy一件包)
- python 操作消息队列
- CentOS学习笔记--SCSI 设备热插拔
- RandomAccessFile、FileChannel、MappedByteBuffer读写文件
- DBMS_ERRLOG记录DML错误日志(一)
- 干净的 ef for Oracle appconfg配置
- phoneGap 中修改生成APP的名字
- migrate from weblogic to tomcat: directory mapping--reference
- [转]关于Chrome不能登录和同步的解决方法
- 为net-snmp添加读readTimeTicks
- Java版网络爬虫基础(转)
- Luogu 1006 传纸条 / NOIP 2008 传纸条(动态规划)
- Struts2.3.34+Hibernate 4.x+Spring4.x 整合二部曲之下部曲
- (NO.00003)iOS游戏简单的机器人投射游戏成形记(十六)
- MySQL主主复制(双主复制)配置过程介绍
- h5端呼起摄像头扫描二维码并解析
- python基础之 026 包以及包的引入
- 唯品会osp简介(转)
热门文章
- WebStorm开发工具设置React Native智能提示
- Mahout 算法
- php 运行linux命令 与 linux下命令行执行php
- Gradle 1.12用户指南翻译——第二十五章. Scala 插件
- Gradle 1.12用户指南翻译——第四十章. ANTLR 插件
- 第一个Polymer应用 - (0)准备工作
- 使用Material Design Tint和视图详解
- iOS评分功能、APP中打开其他应用程序
- Windows2008修改密码策略简单介绍
- DB查询分析器访问EXCEL时,要在表名前后加上中括弧或双引号