李子的密码加密 随机数 完

哦我的天哪小伙伴们大家好,我是李子!终于上次水写了密码加密后,直接肝了一天,终于,完成了!

代码

来吧,上代码!

#include<iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
using namespace std;
char pwd[256];//Input word
char tmp[256];//Temp
char opwd[256];//Out word
int finish=0;//Number of characters
string code="BLPASDWOIRU94354980";
void welcome()
{cout<<"--------------------------------------"<<endl;cout<<"---------------password.exe-----------"<<endl;cout<<"--------------------------------------"<<endl;cout<<"****Using random number encryption****"<<endl;
}
void decrypt()
{cout<<"Dear VIP,you have chosen decrypt."<<endl;cout<<"Please enter Number of characters"<<endl;cin>>finish;cout<<"Please enter CHARACTERS STRING"<<endl;for(int i=0;i<finish;i++){cin>>pwd[i];}for(int i=0;i<finish;i++){tmp[i]=pwd[i];}cout<<"Please enter the random number."<<endl;int r=0;cin>>r;for(int i=0;i<finish;i++){tmp[i]=tmp[i]-r;}for(int i=0;i<finish;i++){opwd[i]=tmp[i];}cout<<"Encrypted string:";for(int i=0;i<finish;i++){cout<<pwd[i];}cout<<endl<<"Original string:";for(int i=0;i<finish;i++){cout<<opwd[i];}
}void encrypt_vip()
{cout<<"Dear VIP, you have chosen encryption."<<endl;cout<<"Please enter Number of characters"<<endl;cin>>finish;cout<<"Please enter CHARACTERS STRING"<<endl;for(int i=0;i<finish;i++){cin>>pwd[i];}for(int i=0;i<finish;i++){tmp[i]=pwd[i];}srand((unsigned)time(NULL));int r=rand()%100;for(int i=0;i<finish;i++){tmp[i]+=r;}for(int i=0;i<finish;i++){opwd[i]=tmp[i];}cout<<"Original string:";for(int i=0;i<finish;i++){cout<<pwd[i];}cout<<endl;cout<<"Encrypted string:";for(int i=0;i<finish;i++){cout<<opwd[i];}cout<<endl;cout<<"random number:";cout<<r<<endl;cout<<"THANKS!";
}
void encrypt()
{cout<<"Please enter Number of characters"<<endl;cin>>finish;cout<<"Please enter CHARACTERS STRING"<<endl;for(int i=0;i<finish;i++){cin>>pwd[i];}for(int i=0;i<finish;i++){tmp[i]=pwd[i];}srand((unsigned)time(NULL));int r=rand()%50;for(int i=0;i<finish;i++){tmp[i]+=r;}for(int i=0;i<finish;i++){opwd[i]=tmp[i];}cout<<"Original string:";for(int i=0;i<finish;i++){cout<<pwd[i];}cout<<endl;cout<<"Encrypted string:";for(int i=0;i<finish;i++){cout<<opwd[i];}cout<<endl;cout<<"random number:";cout<<r<<endl;cout<<"THANKS!";
}
void usercode()
{cout<<"---------------------------------"<<endl;cout<<"-------------user code-----------"<<endl;cout<<"---------------------------------"<<endl;encrypt();
}
void vipcode()
{cout<<"**************************************"<<endl;cout<<"****************VIP CODE**************"<<endl;cout<<"**************************************"<<endl;cout<<"You are the VIP"<<endl;cout<<"You can use decrypt"<<endl;int choose;cout<<"ENCRYPT,1  ;  DECRYPT,2";cin>>choose;if(choose==1){encrypt_vip();}else{decrypt();}
}
//Check whether it is a VIP user
bool check()
{cout<<"If you are a VIP user, please press 1, if not, press 0";int ch=0;cin>>ch;if(ch==1){cout<<"Please enter PASSWORD:";string icode;cin>>icode;if(icode==code){return true;}else{return false;}}else{return false;}
}
int main()
{welcome();if(check()==true){//VIPcout<<"VIP!!";cout<<"OMG,You are the VIP, right?"<<endl;cout<<"So,you can use 1~100 encryption"<<endl;vipcode();}else{//USERcout<<"USER.";cout<<"You are the USER,You only can use 1~50 encryption, and you can't use decrypt."<<endl;usercode();}return 0;
}

李子的密码加密!(随机数版)完相关推荐

  1. 李子的密码加密!!!!(随机数版)

    李子的密码加密(随机数!) 我们先把这次作品思路理一下 (mmp,忘说开场白了) 哈喽各位亲爱的小伙伴们大家好,这里是李子!(我是一名名叫开场白的开场白) 看到标题,你们肯定已经知道,这次我要挑(水) ...

  2. Java版 凯撒密码 加密、解密、暴力破解

    Java版 凯撒密码 加密.解密.暴力破解 用Java实现凯撒密码的 '加密' 和 '解密' 工作 代码实现如下: 代码片 package com.hellow.demo;import java.ut ...

  3. 数据库身份证号加密密码加密_使用密码加密数据

    数据库身份证号加密密码加密 介绍 (Introduction) When we're encrypting data, typically we will create a random key th ...

  4. 用户密码加密存储十问十答,一文说透密码安全存储

    点击上方"方志朋",选择"设为星标" 回复"666"获取新整理的面试文章 作者 | 程序员赵鑫 来源 | cnblogs.com/xinzh ...

  5. qq音乐登录参数详细分析及密码加密最新版

    QQ音乐网页版登录参数全解析 大家可以关注我的 Github https://github.com/GitHub-ZC/ 大家可以加入我的 QQ群 大家可以关注一下我的微信公众号:每天都有精彩资源推荐 ...

  6. 43.【Java 实现验证码获取 C++实现密码加密和删除和QQ登入系统】

    Java实现验证码信息 (一).简要概述: 1.思路分析 2.代码展示: 3.效果展示: (二).密码加密C++操作 1.基本思路和解析: 2.代码展示: (三).QQ登入系统: 1.建设QQ登入系统 ...

  7. php 挂马 密码123456,admin密码-常用密码加密md5值,123456,admin,admin888

    一 : 常用密码加密md5值,123456,admin,admin888 123456这个经md5算法加密之后是多少? 16位:49ba59abbe56e057 32位:e10adc3949ba59a ...

  8. 小黑小波比.保存密码加密方式

    2019独角兽企业重金招聘Python工程师标准>>> 为了用户安全,添加密码加密 Client/scripts/GUI/Admin/PasswordRecover.js var h ...

  9. Openldap配置TLS加密传输(完整版——shell脚本实现[分别在客户端与服务器端执行脚本,实现TLS加密])

    此脚本中只是负责实现了TLS加密配置部分,openLDAP的编译安装以及设置是前期已经配置好的! 具体的配置看上上篇文章openLDAP的编译安装以及配置. 注意slapd.conf中的配置,脚本中为 ...

最新文章

  1. (NO.00001)iOS游戏SpeedBoy Lite成形记(十)
  2. IT 行业的创新 - 创新的迷思 (5-6)
  3. 可爱的python_《可爱的Python》读书笔记
  4. python join_Python中join()方法的用法
  5. centos7.x中设置hostname方法
  6. 电脑PC端实现微信多开
  7. R语言课程设计之-深圳房价预测模型
  8. 远程桌面访问软件:TeamViewer
  9. php 去逗号,php如何去除两边逗号
  10. mcinabox运行库下载安装_mcinabox运行库下载
  11. SqlServer2008操作总结
  12. yolo极大抑制_Pytorch从0开始实现YOLO V3指南 part4——置信度阈值和非极大值抑制...
  13. 简单的水果价格排序(价格不重复)
  14. 使用Statsmodels在Python中进行重复测量方差分析
  15. Verilog基础知识
  16. MySQL之主键约束、非空约束、唯一约束
  17. 美元指数展现王者风范 国际黄金重返下跌通道
  18. 趣味c语言代码,趣味程序C语言
  19. S3C2410 UART驱动
  20. 头条发布文章如何一篇文章发布道30+自媒体平台?

热门文章

  1. 重磅 | 李飞飞最新演讲:ImageNet后,我专注于这五件事——视觉理解、场景图,段落整合、视频分割及CLEVR数据集...
  2. linux储存卡的格式,sd卡有几种格式?
  3. MATLAB处理数据,掌握这几个小技巧就够了
  4. IntentFilter
  5. DC 视频教程 第八期
  6. 和孩子斗智斗勇-如何限制只运行上网课的程序(Windows篇)
  7. 2017届中兴综合面试
  8. 雷达手势识别技术概述
  9. 动易2005、2006版常见错误号的原因分析及解决方法
  10. [Unity2D]Tilemap Collider2D只给部分地图瓦片加上Collider的方法