加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

CCProxy字符串加密解密代码

(2011-07-09 10:20:30)
标签:

ccproxy

密码

编码

解码

it

分类: 网络编程
原文于2006年8月5号发布在自己的QQ空间,现转载过来!

在网络上看到CCProxy的加密算法为999-ASCII(c)(本来好长的算法,被我总结成了一句),所以自己写了一个加密解密的程序,比网络上的只是一解密功能的要算法要简单多了,只用while完成加密解密功能。

C++代码 
  1. #include <string.h>  
  2. #include <stdio.h>  
  3. int main(int argc, charargv[])  
  4.  
  5.     char chEnString[128] {0};  
  6.     char chDeString[43]  {0};  
  7.       
  8.     if (argc!=3)  
  9.      
  10.         printf("Usage: Password.exe [-decode|-encode] \"string\"");  
  11.         return 0;  
  12.      
  13.     if (strcmp(argv[1],"-decode")==0)  
  14.      
  15.         strcpy(chEnString,argv[2]);  
  16.         int 0;  
  17.         while (chEnString!='\0' 
  18.          
  19.             int ch =999 -( (chEnString-48)*100+(chEnString-48)*10+chEnString-48);  
  20.             printf("%c",ch);  
  21.             += 3;  
  22.          
  23.      
  24.     else if(strcmp(argv[1],"-encode")==0)  
  25.      
  26.         strcpy(chDeString,argv[2]);  
  27.         int 0;  
  28.         while (chDeString[j]!='\0' 
  29.          
  30.             int temp 999-chDeString[j];  
  31.             printf("=",temp);  
  32.             j++;  
  33.          
  34.      
  35.     else  
  36.         printf("Usage: Password.exe [-decode|-encode] \"string\"");  
  37.     return 0;  
  38. }  

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有