惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - 苹果王子

c++ 属性 一维动态数组类模板 加密技术(学习笔记四矩阵加密) 窗口 交互 窗口的方法 加密技术(学习笔记三)Replace 加密技术(学习笔记一) net2008+sql2008 安装问题指南 补丁更新服务器二(多线程下载+进度条) Thread交叉访问的问题..... 随便写点c++学习笔记 补丁更新服务器一 领带的打法 爱程序有错吗? 学习笔录-ref ASP.NET....为能开始侦听端口的解决办法 轻松一下(添加参数的烦恼) 只为今天(转)希望之源 数据访问框架(正在商业应用中的- -) - -从头在来
加密技术(学习笔记=)Caesar算法
苹果王子 · 2008-11-01 · via 博客园 - 苹果王子

一个传统的算法(拥有2000年历史)非常古老的算法,就是字母移动位..

比如:

//--直接让字符串+偏移位(甚至可以减去偏移位)
        char aaa = Convert.ToChar(('中'+2) );
        Console.WriteLine(aaa);
//---解密的时候反转就可以了
        char bbc = Convert.ToChar(((aaa) - 2));

但是这就设计到一个问题,可以用反转的方式,比如说让所有的字符串减几来推测,可能的明文,这样不安全的说.


for(int a=0;a<100;a++)
{
  //----看这里就可以循环破译了
 char bbc = Convert.ToChar(((aaa) - a));
}

修改下 针对上面的破译可以有通过随机函数针对每一位进行偏移- -这时候就需要一个对应的偏移key记录偏移顺序的阿阿

关键点:

 RandomNumberGenerator rng = new RNGCryptoServiceProvider(); 生成随机 数组

对随机数组+上原文

            for (int i = 0; i < Key.Length; i++)
            {
                if (Key[i] < 2)
                {
                    Key[i] = 2;
                }

                sb[i] = (char)(sb[i] + Key[i]);
            }

CaesarRandom

调用