반응형

/dev/random

위키의 정의 : 유닉스 계열 운영 체제에서 차단 방식의 유사난수 발생기의 역할을 수행하는 특수 파일이다. 장치 드라이버와 기타 소스로부터 모은 환경적 노이즈로의 접근을 허용한다.


/dev/urandom 도 /dev/random 과 동일한 방식으로 난수를 생성하지만 다른 점은 아래와 같다고 합니다.

urandom이 random보다 난수를 대충만들어서 속도는 더 빠르지만 훌륭한 난수는 되지 못한다. 뭐 대충 이런 내용입니다.

urandom이 예측하기 쉬운 난수가 만들어질 수 있어서 보안에 취약해 질수 있다고는 하지만,

예측하기 쉬운 난수가 만들어지는 OS  환경이라면 random의 경우 매우 느려지거나 아예 락이 걸려서 난수를 생성하지 못할 수 있다고 하니 어떤 녀석을 써야할까요?

If you want random data in a Linux/Unix type OS, the standard way to do so is to use /dev/random or /dev/urandom. These devices are special files. They can be read like normal files and the read data is generated via multiple sources of entropy in the system which provide the randomness.


/dev/random will block after the entropy pool is exhausted. It will remain blocked until additional data has been collected from the sources of entropy that are available. This can slow down random data generation.


/dev/urandom will not block. Instead it will reuse the internal pool to produce more pseudo-random bits.


/dev/urandom is best used when:


You just want a large file with random data for some kind of testing.

You are using the dd command to wipe data off a disk by replacing it with random data.

Almost everywhere else where you don’t have a really good reason to use /dev/random instead.

/dev/random is likely to be the better choice when:


Randomness is critical to the security of cryptography in your application – one-time pads, key generation.


참고 : ora11g jdbc connection reset 


반응형

+ Recent posts