使用中文单词创建自定义加密/解密 [英] Creating custom encryption/decryption with chinese words

查看:91
本文介绍了使用中文单词创建自定义加密/解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。

我正在尝试创建一个加密/解密系统,将字符串/数字/符号转换为中文单词。



我做了一个smtole

但是这很简单,容易打破。

如何使这种加密复杂化?

使用随机字符或ascii代码?!



我尝试过:



 private string encryptToChinese(string text)
{
string output =;
char [] chineseChars =唠唡唢唣唥唧唧唧唧唬唬唬唭唯唯唯嗉嗉嗉嗉嗉嗉。。嗉。。。。.ToCharArray();
output = txtInput.Text.ToUpper();

foreach(输出中的char c)
{
int index = char.ToUpper(c) - 65;
if(index< chineseChars.Length&& index> = 0)
output = output.Replace(c,chineseChars [index]);
其他
继续;
}
返回输出;
}

解决方案

我建​​议从这里开始:数据加密和解密(Windows) [ ^ ]



以下是字符串加密/解密的示例:演练:在视觉中加密和解密字符串基本 [ ^ ]

Hello.
Im trying to create an encryption/decryption system which convert strings/numbers/symbols into the chinese words.

I made a smiple one
But this is very simple and easy to break.
How can i complicate this encryption?
using random characters or ascii codes?!

What I have tried:

private string encryptToChinese(string text)
        {
            string output="";
            char[] chineseChars = "唠唡唢唣唤唥唦唧唨唩唪唫唬唭售唯嗀嗁嗂嗃嗄嗅嗆嗇嗈嗉".ToCharArray();
            output = txtInput.Text.ToUpper();

            foreach(char c in output)
            {
                int index = char.ToUpper(c) - 65;
                if (index < chineseChars.Length && index >= 0)
                    output = output.Replace(c, chineseChars[index]);
                else
                    continue;
            }
            return output;
        }

解决方案

I'd suggest to start here: Data Encryption and Decryption (Windows)[^]

Here is an example of string encryption/decryption: Walkthrough: Encrypting and Decrypting Strings in Visual Basic[^]


这篇关于使用中文单词创建自定义加密/解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆