zoukankan      html  css  js  c++  java
  • 简单的信息加密解密

    原网址:http://blog.csdn.net/ykm0722/article/details/6947265

    在互联网传输数据,安全性是一个非常重要的保证。。如何加密也成为了一个研究热点。。在C语言中,我们可以通过各种算法实现加密,以下是一个简单的加密和解密算法:加密时,将字符低四位取反,解密时,将低四位再次取反,代码如下: 
    #include<stdio.h> 
    #define  LEN 100 
    main() 

    char str[LEN]; 
    int i; 
    float x; 
    printf("please input a string: "); 
    gets(str); 
    i=0; 
    while(str[i]) 

    str[i]=str[i]^07; 
    i++; 

    printf("编码后的字符串是:%s ",str); 
    i=0; 
    while(str[i]) 

    str[i]=str[i]^07; 
    i++; 

    printf("解码后的字符串是:%s ",str); 

    }

  • 相关阅读:
    字符串哈希
    codeforces#766 D. Mahmoud and a Dictionary (并查集)
    莫比乌斯反演模板
    马拉车模板
    codeforces#580 D. Kefa and Dishes(状压dp)
    1076E
    448C
    543A
    295B
    poj3974 Palindrome
  • 原文地址:https://www.cnblogs.com/lanye/p/3487784.html
Copyright © 2011-2022 走看看