C#加密格式 [英] C# Encryption Format
问题描述
我假设你不是在谈论像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屋!