English 中文(简体)
是否有强有力的关键材料?
原标题:Is /proc/sys/kernel/random/uuid strong keying material?
  • 时间:2011-05-03 17:09:09
  •  标签:
  • random
  • uuid

I ve been looking at ways to generate a strong 256 bit/32 byte symmetric key for the HMAC_SHA256 algorithm. I stumbled upon the /proc/sys/kernel/random/uuid file.

According to man random(4): "The read-only files uuid and boot_id contain random strings like 6fd5a44b-35f4-4ad4-a9b9-6b9be13e1fe9. The former is generated afresh for each read, the latter was generated once."

The string from cat /proc/sys/kernel/random/uuid 期望实现这一目标。 我可以去除这些果园,最后用32个随机.。

这种做法是否是一种有效的方法,能够产生关键材料的加密有力来源?

问题回答

一个老问题,但如果有人 st倒,我不建议这个问题。

/proc/sys/kernel/random/uuid is a category 4 (random) UUID with certain semantics - it s not only a string of arbitrary hex natures. 例如,第三组中位数位数的位数总是4位。

256个随机参照点仅从<代码>/dev/random(外在外围,可编组)或<代码>/dev/urandom(每区块)。

o172.net是最好的答案,可以直接评论,但不能。

<代码>/proc/sys/kernel/random/uuid以<代码>urandom为基础,但最好能直接从圆.中 gr。

下面是如何从壳体中取出,下面是32英寸:

echo $(tr -dc a-f0-9 < /dev/urandom | dd bs=32 count=1 2> /dev/null)

您可通过<条码>> >t<>t/code> params, 即:

dd bs=
or not use tr

and get random binary.





相关问题
Weighted random numbers

I m trying to implement a weighted random numbers. I m currently just banging my head against the wall and cannot figure this out. In my project (Hold em hand-ranges, subjective all-in equity ...

Comprehensive information about hash salts

There are a lot of questions about salts and best practices, however most of them simply answer very specific questions about them. I have several questions which feed into one another. Assuming a ...

Generate unique names?

I am working on a php site in which we have to upload images from users.i have to rename that file for preventing conflicts in the name of the image. uniqid(rand(), true); and adding a large random ...

How to get two random records with Django

How do I get two distinct random records using Django? I ve seen questions about how to get one but I need to get two random records and they must differ.

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

热门标签