如何去code SHA384哈希? [英] How to decode SHA384 hash?

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

问题描述

我创建一个SHA384哈希值。我要脱code散列。是否有任何可能的方式做到这一点?请帮助

I am creating a SHA384 hash. I want to decode that hash. Is there any possible way to do this? Please help

以下是code获得哈希

Following is the code to get hash

public String getHash(String message) {
    String algorithm = "SHA384";
    String hex = "";
    try {
        byte[] buffer = message.getBytes();
        MessageDigest md = MessageDigest.getInstance(algorithm);
        md.update(buffer);
        byte[] digest = md.digest();

        for(int i = 0 ; i < digest.length ; i++) {
            int b = digest[i] & 0xff;
            if (Integer.toHexString(b).length() == 1) hex = hex + "0";
            hex  = hex + Integer.toHexString(b);
        }
        return hex;
    } catch(NoSuchAlgorithmException e) {
        e.printStackTrace();
        return null;
    }

}


推荐答案

一个加密安全散列函数是一个函数,使得给定的任意长度的输入被处理成以这样的方式固定长度输出是不可逆的(计算上是不可行)。这样的功能包括MD5和SHA(安全散列算法)家族(1,224,256,384,512等)。

A cryptographically secure hashing function is a function such that a given arbitrary length input is processed into a fixed length output in such a way that is not reversible (computationally infeasible). Such functions include MD5 and the SHA (Secure Hash Algorithm) family (1, 224, 256, 384, 512, etc).

一旦你把输入的哈希有没有打算回到原来的输入。此属性可用于消息完整性验证作为哈希相同的消息产生相同的哈希值。

Once you take the hash of the input there is no going back to the original input. This property can be used for verification of message integrity as hashing the identical message produces a identical hash.

在访问该网站简单地通过侧存储哈希和它们的输入侧并执行一个数据库查找为您的散列试图找到一个可能的输入(如果它是previously添加到数据库中)。

The website you visited simply stores hashes and their inputs side by side and does a database lookup for your hash to attempt to find a possible input (if it was previously added to the database).

这篇关于如何去code SHA384哈希?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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