Vernam加密法
2015-09-23 18:48
204 查看
[code]#include <stdio.h> #include <iostream> #include <math.h> #include <stdlib.h> #include <ctype.h> #include <algorithm> #include <vector> #include <string.h> #include <string> #include <queue> #include <stack> #include <set> #include <sstream> #include <time.h> using namespace std; char clear_text[10000]; string ans; char key[10000]; int main() { memset(key, 0, sizeof(key)); ans.clear(); printf("please enter the clear_text :"); scanf("%s", clear_text); int len = strlen(clear_text); printf("please enter key :"); scanf("%s", &key); for (int i = 0;i < len;i++) { int tmp = (clear_text[i] - 'a' + key[i] - 'a') % 26; ans += (char)(tmp + 'a'); } cout << ans << endl; return 0; }
相关文章推荐
- CentOS6.x安装xen4.2虚拟化实践
- 怎么才能编辑PDF里面的内容
- UICollectionView基础
- 隐藏nginx版本号,以加强服务安全
- RichEdit的复制与粘贴
- 百度地图sdk---地图定位功能的错误has leaked ServiceConnection com.baidu.location.LocationClient
- 学习方法
- BZOJ 1007: [HNOI2008]水平可见直线( 计算几何 )
- ubuntu apache2 wsgi 部署django
- Hibernate的generator属性
- ZOJ.3437 Very Hard Problem【strtoll函数】 2015/09/23
- intro: what's the problem
- 在做微信第三方的时候遇到的问题、导包问题
- [memcached]部署memcached环境及PHP扩展
- mysqldump备份警告
- 探索Ionic过程中的一些亮点与各种坑整理
- LeetCode(49) Populating Next Right Pointers in Each Node I II
- 数据库存储树形结构的数据
- 安卓:ActionBar的分离
- quick减少包体