python实现换位加密算法的示例
作者:Cosmop01itan 时间:2022-08-04 20:46:36
如下所示:
def translationCipher(msg,key):
result = [""]*key
for i in range(key):#把每一列元素按照顺序相加组成新的字符序列
pointer = i
while i<len(msg):
result[pointer]+=msg[i]
i+=key
return ''.join(result)
def main():
print translationCipher("hello,world",4)#以4个字母为一行进行换位加密
if __name__=="__main__":
main()
来源:https://blog.csdn.net/CosmopolitanMe/article/details/72905433
标签:python,换位,加密
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python的输入,输出和标识符详解
2021-03-26 21:50:42
java前端javascript生成动态表格示例演示
2023-08-24 11:13:45
![](https://img.aspxhome.com/file/2023/2/56142_0s.gif)
AJAX:如何处理书签和后退按钮
2008-03-21 18:44:00
新版php study根目录下文件夹无法显示的图文解决方法
2023-11-15 00:44:29
![](https://img.aspxhome.com/file/2023/8/89728_0s.png)
利用python读取YUV文件 转RGB 8bit/10bit通用
2023-09-05 08:33:19
Python异步之迭代器如何使用详解
2023-09-10 17:48:34
详解Python中常用的激活函数(Sigmoid、Tanh、ReLU等)
2022-03-25 22:45:51
![](https://img.aspxhome.com/file/2023/5/90445_0s.png)
MySQL字符串索引更合理的创建规则讨论
2024-01-24 19:10:55
![](https://img.aspxhome.com/file/2023/0/68110_0s.png)
Python3.7中安装openCV库的方法
2021-07-07 04:23:32
详解MySQL索引原理以及优化
2024-01-16 18:18:25
![](https://img.aspxhome.com/file/2023/5/72445_0s.jpg)
nodejs简单实现TCP服务器端和客户端的聊天功能示例
2024-05-03 15:55:56
python for循环内输出和外输出方式
2022-09-25 10:19:06
![](https://img.aspxhome.com/file/2023/9/124129_0s.jpg)
Sql Server基本函数
2024-01-24 05:32:29
python判断一个对象是否可迭代的例子
2021-01-04 18:19:23
python对站点数据做EOF且做插值绘制填色图
2023-03-05 03:30:56
![](https://img.aspxhome.com/file/2023/8/93488_0s.png)
Go语言二进制文件的读写操作
2023-06-23 09:40:08
MySQL的时间差函数TIMESTAMPDIFF、DATEDIFF的用法
2024-01-25 04:39:33
Django搭建项目实战与避坑细节详解
2021-04-30 06:46:46
![](https://img.aspxhome.com/file/2023/2/78482_0s.png)
文字解说Golang Goroutine和线程的区别
2023-10-15 18:56:36
python中from module import * 的一个坑
2021-10-29 08:23:51