gpt4 book ai didi

java - SecureRandom.getInstance ("DRBG"使用什么实际算法)?

转载 作者:行者123 更新时间:2023-11-29 07:23:51 25 4
gpt4 key购买 nike

Java 9 (JSR 379) introduces the NIST DRBG'sJEP 273 中所述.但是,NIST 文档 SP 800-90Ar1 (NIST Special Publication 800-90A Revision 1: Recommendation for Random Number Generation Using Deterministic Random Bit Generators) 规定了总共的树机制:

Implement the three DRBG mechanisms (Hash_DRBG, HMAC_DRBG, CTR_DRBG) in 800-90Ar1 (on all platforms).

但是,尽管您可能希望我们现在可以使用三种方法来创建这种安全的随机算法:

  1. SecureRandom.getInstance("Hash_DRBG")
  2. SecureRandom.getInstance("HMAC_DRBG")
  3. SecureRandom.getInstance("CTR_DRBG")

可能有各种配置参数,我们似乎只有一个:

  1. SecureRandom.getInstance("DRBG")

那么开发人员如何配置和检测使用了哪一种算法?

最佳答案

来自JEP

A new SecureRandomParameters interface so that additional input can be provided to the new SecureRandom methods.

从那里我们到达 DrbgParameters这说

Implementation Note:

The following notes apply to the "DRBG" implementation in the SUN provider of the JDK reference implementation. This implementation supports the Hash_DRBG and HMAC_DRBG mechanisms with DRBG algorithm SHA-224, SHA-512/224, SHA-256, SHA-512/256, SHA-384 and SHA-512, and CTR_DRBG (both using derivation function and not using derivation function) with DRBG algorithm AES-128, AES-192 and AES-256.

The mechanism name and DRBG algorithm name are determined by the security property securerandom.drbg.config. The default choice is Hash_DRBG with SHA-256.

因此,依赖于实现并具有默认实现,只能通过属性进行切换。

关于java - SecureRandom.getInstance ("DRBG"使用什么实际算法)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58304220/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com