本文介绍了相当于Java的C#的Rfc2898DerivedBytes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人试图做的等效

I was wondering if anyone have tried to do an equivalent of

Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(secret, saltValueBytes);
byte[] secretKey = key.GetBytes(16);

在Java中。其中的秘密是一个字符串(密码),并saltValueBytes是,那么,在字节数组中的盐。

in Java. Where secret is a string(password), and saltValueBytes is, well, a salt in byte array.

我尝试过的东西,但似乎无法环绕它我的头。

I've tried stuff, but can't seem to wrap my head around it.

推荐答案

我发现此实现通过谷歌搜索的方式,但我从来没有使用过。

I found this implementation by means of a Google search but I have never used it.

一个免费的Java实现RFC 2898中  / PKCS#5 PBKDF2

似乎有不小的和自由  可用的Java实现的RFC  2898 / PKCS#5可用。小如  只有少数的源文件,琐碎  编译并没有依赖性,免费为  在LGPL。

There seems to be no small and freely available Java implementation of RFC 2898 / PKCS#5 available. Small as in only a few source files, with trivial compile and no dependencies, free as in LGPL.

由于HMACSHA1的可用性  标准SUN JCE密码  提供商,这样的实施是  相当简单,并且可以从来自  该RFC描述毫不夸张。  我的code是一个洁净室执行  仅与RFC为基础

Given the availability of HMacSHA1 in the standard SUN JCE cryptographic provider, such an implementation is quite simple and can be derived from the RFC description quite literally. My code is a clean-room implementation with only the RFC as its basis.

这篇关于相当于Java的C#的Rfc2898DerivedBytes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 10:27