如何解密下面的加密代码 [英] How to decrypt from encrypt code below

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

问题描述

Protected Function encrypt(ByVal pass As String) As String

       encrypt = Nothing
       Dim bytPassword As Byte() = Nothing
       Dim bytHash As Byte() = Nothing
       Dim sha1Obj As SHA384Managed = New SHA384Managed()
       bytPassword = Encoding.UTF8.GetBytes(pass)
       bytHash = sha1Obj.ComputeHash(bytPassword)

       sha1Obj.Clear()

       encrypt = System.Convert.ToBase64String(bytHash)
 End Function





我尝试过:



如何解密下面的加密代码



What I have tried:

how to decrypt from encrypt code below

推荐答案

SHA384不是密码算法,这是一个哈希算法。

你不能解密一个哈希值;因此,不可能从其散列值返回初始值。



如果要比较散列密码,则必须计算所提供密码的散列值,并将其与存储的哈希值进行比较。
SHA384 is not a cypher algorithm, it's a hash algorithm.
You cannot "decrypt" a hash value; thus, it is impossible to get the initial value back from its hashed value.

If you want to compare hashed passwords, you have to compute the hash of the provided password, and compare it to the stored hash-value.


第一个答案是100% - 但我会用它来向您解释它在更简单的细节中意味着什么。



加密/解密:这些用于获取某种数据(如消息)并使其无法读取(加密),直到有合适工具的人可以将其转换回原始数据形式(解密)。这通常需要一些密码,因此只需使用相同的工具就不会打开门。



哈希:是一种获取数据的方法,通过数学算法,将其转换为原始数据应该唯一的新值。在这种情况下唯一的意思是,如果您(1)以相同的数据开始,并且(2)应用相同的哈希算法,(3)您将得到相同的结果。然而,基本上,数据被切片,切块,切碎和以不可逆转的方式碾碎。例如,如果我使用类似添加的东西作为我的哈希算法,并且我给你答案为100,你不知道我是如何得到的:1 + 99,3 + 72 + 25等等,这例子很粗糙。真正的哈希是非常大的结果来自更复杂的算术,因此意外地具有相同的值几乎是不可能的。



所以 - 对于加密,你有一个结果可以是恢复到原来的状态。对于Hash,您无法撤消它。然而,您可以做的是哈希一个已知值并测试它是否与您的存储值匹配(例如,密码)。

The first answer was 100% - but I'll use this to explain to you what it means in simpler detail.

Encryption/Decryption: these are used to take data of some kind (like a message) and make it unreadable (encryption) until someone with the proper tool can convert it back to its original form (decryption). This usually takes a password of some kind so that simply having the same tool won't open the door.

Hash: Is a way to take data and, through a mathematical algorithm, convert it to a new value that should be unique to the original data. Unique in this case only means that if you (1) start with the same data, and (2) apply the same hash algorithm, (3) you'll get the same result. Basically, though, the data was sliced and diced and chopped and scrunched in ways that cannot be reversed. For example, if I use something like addition as my hash algorithm, and I give you the answer as 100, you don't know how I got it: 1+99, 3+72+25, etc., etc., This example is very crude. True hashes are very large results from much more complicated arithmetic so accidentally having the same value is all but impossible.

So - for encryption, you have a result that can be restored to its original state. For a Hash, you cannot undo it. What you can do, however is hash a known value and test to see if it matches your stored value (example, passwords).


引用:

如何解密下面的加密代码

how to decrypt from encrypt code below

你没有!

因为SHA384是僵尸加密,所以它不可逆。

SHA就像一个校验和。

示例:得到这个值12345678987654321011234596789

得到校验和t(他的方式:12 + 34 + 56 + 78 + 98 + 76 + 54 + 32 + 10,你得到450你再次申请4 + 50和你54作为校验和。

你想要的是扭转这个过程,它是不可能。

SHA更加复杂,因为很难找到2个能产生相同结果的字符串,这是SHA的所有兴趣。

You don't!
Because SHA384 is bot encryption, it is not reversible.
SHA is like a checksum.
Example: get this value 12345678987654321011234596789
get the checksum t(his way: 12+34+56+78+98+76+54+32+10, you get 450 and you apply again to 4+50 and you 54 as a checksum.
what you want is to reverse the process, it is impossible.
SHA is just more complicated in the way that it is very hard to find 2 strings that will give the same result, and it is all the interest of SHA.


这篇关于如何解密下面的加密代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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