C#加密格式 [英] C# Encryption Format

查看:146
本文介绍了C#加密格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法找到字符串的加密格式?我的意思是说我有一个加密的字符串,我想知道哪个方法用于加密字符串,因为不同的加密方法加密不同格式的字符串。

解决方案

我假设你不是在谈论像Base64这样的东西,而是使用3DES,AES,RC4或其他任何方式加密。



答案是不,你不能说。任何好的加密都会产生随机的输出。您可以从输出的大小中了解一点。如果它是16位的倍数,那么它可能是128位密码,如AES。如果它是8位的倍数,而不是16的倍数,那么它可能是像DES或3DES这样的64位密码。如果它不是任何一个,那么它可能是一个流密码:RC4或Salsa20,或者一个流式的模式中的块密码:CTR或GCM。


Is there any way to find the encryption format of a string? I mean to say that I have a encrypted string and I want to find out which method was used to encrypt the string, because different encryption methods encrypt strings in different format.

解决方案

I assume that you are not talking about something like Base64, but about encryption using 3DES, AES, RC4 or whatever.

The answer is no, you cannot tell. Any good encryption produces output that appears random. You can tell a little from the size of the output. If it is a multiple of 16 bits then it may well be a 128 bit cypher, like AES. If it is a multiple of 8 bits, but not of 16, then it is probably a 64 bit cypher like DES or 3DES. If it is not a multiple of either then it is probably a stream cypher: RC4 or Salsa20, or a block cypher in one of the stream-like modes: CTR or GCM.

这篇关于C#加密格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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