凯撒加密的改进算法(C#版)
来源:互联网 发布:女性按摩棒原理知乎 编辑:程序博客网 时间:2024/06/06 04:01
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace move
{
class Program
{
#region//定义移动任意位函数
static void move(string s,int n)
{
int m = n % 26;
char[] move = new char[s.Length];
string s1 = "abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < s.Length;i++ )
{
if (s[i] >= 97 && s[i] <= 122)
{
for (int j = 0; j < 26;j++ )
{
if(s1[j] == s[i])
{
if (s[i] + m <= 122)
{
move[i] = (char)(s1[j] + n);
break;
}
else
{
move[i] = (char)(s1[j] + m - 122 + 96);
break;
}
}
}
}
}
for (int k = 0; k < s.Length; k++)
{
Console.Write(move[k]);
}
Console.ReadKey();
}
#endregion
#region//主函数体
static void Main(string[] args)
{
string s;
int n;
Console.WriteLine("Input the plaintext.");
s = Console.ReadLine().ToLower();
Console.WriteLine("Input the number.");
n = Convert.ToInt32(Console.ReadLine());
move(s,n);
}
#endregion
}
}
- 凯撒加密的改进算法(C#版)
- shell 凯撒加密(位移)算法
- C#实现“凯撒”密码的算法
- JAVA加密解密之凯撒加密(Caesar cipher)算法
- 凯撒的加密术
- 凯撒密码的简单改进
- 维吉尼亚密码--在简单加密方式凯撒密码基础上的一个改进
- 凯撒密码,简单的加密
- 凯撒密码加密你的姓名拼音(c)
- 密码学之凯撒加密解密算法
- 第四十九篇: JAVA加密解密之凯撒加密(Caesar cipher)算法
- 凯撒加密
- 凯撒加密
- 凯撒加密
- 凯撒加密
- 凯撒加密
- 凯撒加密
- 经典加密算法凯撒密码、维吉尼亚密码,RSA算法加密的简单学习
- 60 3rd下实现Video Call 与 VoIP Cal
- 大专生JAVA的这条路 ----- 北京之行1(培训头一天晚上)
- 使用RTP/RTCP API来发送数据
- 推荐视频:大自然中的数学
- feof 函数 while循环引发的断错误及调试方法
- 凯撒加密的改进算法(C#版)
- java classLoader 体系结构
- 打印加密pdf (foxit editor)
- VS2005和VS2008下编译libtorrent
- 总结Windows高精度计时API的用法作为今天的小小收获
- 新人啊。喜欢这个站
- 替换Script.NET中Lua解释器使用的lua动态库的方法
- Some linux commands I used
- Catalan数(转自百度百科)