Created
September 5, 2016 16:34
-
-
Save teruteru128/48f5b292a19dbbd6a23815e58202ebd8 to your computer and use it in GitHub Desktop.
JavaにおけるSecureRandomの一つの妥協点 ref: http://qiita.com/teruteru128/items/a0c4a031e708af788591
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.security.SecureRandom; | |
public class Main { | |
public static void main(String[] args){ | |
int seedSize = 16; | |
SecureRandom strong = SecureRandom.getInstanceStrong(); | |
SecureRandom using = new SecureRandom(strong.generateSeed(seedSize)); | |
/* 以降usingを乱数生成器として使用する */ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment