什么是PBEWithMD5AndDes? [英] What is PBEWithMD5AndDes?

查看:92
本文介绍了什么是PBEWithMD5AndDes?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Java加密算法,偶然发现了该算法:

I am learning encryption algorithm in Java and stumble upon this algorithm:

  SecretKey key = SecretKeyFactory.getInstance(
                    "PBEWithMD5AndDES").generateSecret(keySpec);

我知道它代表使用MD5和DES算法的基于密码的加密.我知道MD5和DES是两个单独的算法加密密钥,但是PBEWithMD5AndDes作为算法到底意味着什么?

I know it stands for Password Based Encryption with MD5 and DES algorithms. I know MD5 and DES are two separate algorithm encryption key but what exactly does PBEWithMD5AndDes means as an algorithm?

在线上没有太多资源可以很好地解释这种算法".

There isn't much resources online that does a good explanation regarding this "algorithm".

我希望有人能给出一个简单而简短的解释,以说明这与普通的MD5或普通的DES算法有何不同.

I was hoping someone could give simple and brief explanation about how this is different from a normal MD5 or normal DES algorithm.

推荐答案

扩展先前的答案

PBEWithMD5AndDes作为算法到底意味着什么?

what exactly does PBEWithMD5AndDes means as an algorithm?

PBE正在使用由密码,随机盐和迭代次数生成的加密密钥,请参阅KeySpec参数.

PBE is using an encryption key generated from a password, random salt and number of iterations, see the KeySpec parameters.

KeySpec pbeSpec = new PBEKeySpec(password.toCharArray(), psswdSalt, PBKDF_INTERATIONS, SYMMETRIC_KEY_LENGTH)

这个想法是-密码往往很短且不够随机,因此很容易猜到.使用迭代次数应该会使猜测更加困难.

The idea is - passwords tend to be short and not random enough, so they are easy to guess. Using number of iterations should make the guessing somewhat harder.

PBEWithMD5AndDes 使用MD5和DES生成密钥,请参见示例代码.现实生活中的实现应该使用更多的迭代次数

PBEWithMD5AndDesis using MD5 and DES to generate the key, see the example code. Real life implementation should use much higher number of iterations

仅使用MD5或仅使用DES有何区别?这就是我想知道的.

How does that differ with just using MD5 or just DES? That's what i would like to know.

理论上-您可以使用纯MD5或DES,但是今天的计算机可以非常快速地猜测密码.

In theory - you may use pure MD5 or DES, but today's computer could guess the passwords very fast.

请注意,DES和MD5今天已过时.在商用硬件上不到一分钟的时间就可以发现MD5冲突,而DES使用的是64位密钥,这在当今看来已经很安全了.

Please note DES and MD5 are obsolete today. MD5 collision can be found under a minute on a commodity hardware and DES is using 64 bit key which is pretty short to be considered secure today.

这篇关于什么是PBEWithMD5AndDes?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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