zoukankan      html  css  js  c++  java
  • 对字符串进行加密

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace TEST___1
    {
    class Program
    {
    static void Main(string[] args)
    {
    Console.WriteLine("请输入原字符串");
    string s_test = Console.ReadLine();
    Console.WriteLine("请输入密钥字符串");
    string s_key = Console.ReadLine();
    if (s_test.Length != s_key.Length)
    {
    Console.WriteLine("密钥字符串与原字符串长度必须相等");
    return;
    }
    string ch = "";
    string s_result = "";
    for (int i = 0; i < s_test.Length; i++)
    {
    ch += s_test[i];
    s_result +=(char) (ch[i] ^ s_key[i]);

    }

    Console.WriteLine("加密后的字符串为:");
    Console.WriteLine(s_result);
    Console.ReadLine();
    }
    }
    }

  • 相关阅读:
    Android访问数据库(SQL Server 和 MySQL)
    Andriod开发环境搭建
    SQL 学习记录
    安装双系统 win7 + ubuntu 15.04
    SQL资料
    电脑使用
    python_L7
    ONE
    网页性能优化
    js的继承
  • 原文地址:https://www.cnblogs.com/silvia-z/p/7506921.html
Copyright © 2011-2022 走看看