Tecnologie

Dettaglio dell'articolo:

mercoledì 07 febbraio 2007

Dispositivi random e Java

Supponiamo di dover realizzare in ambiente Linux un programma in Java che utilizza funzioni di crittografia. Ad esempio un sistema per la firma digitale oppure un programma di trasferimento di dati sensibili che utilizzi connessioni sicure https.

La generazioni delle chiavi casuali viene effettuato dalla jvm utilizzando il contenuto generato dai dispositivi /dev/random. Tali dispositivi utilizzano segnali associati ai dispositivi hardware (tastiere, mouse etc) per generare i propri dati casuali.
In alcune condizioni essi possono non contenere dati. Un esempio tipico sono i server disconnessi da tastiera.

Di conseguenza un programma del tipo:

try {

URL url = new URL("https://www.tecnes.com");
url.openConnection();

}catch (Exception e) {
}


potrebbe bloccarsi in attesa della lettura del dispositivo /dev/random.

Per avere informazioni di debug in merito a questo comportamento, si può impostare la seguente opzione per la jvm:

-Djavax.net.debug=ssl

Il programma genera il seguente messaggio in corrispondenza della chiamata del dispositivo random, e successivamante si blocca.

"trigger seeding of SecureRandom".

Soluzione:
Per risolvere il problema sopra esposto, è sufficiente impostare la seguente opzione nella jvm:

-Djava.security.egd=file:/dev/urandom

Tale opzione, detta "entropy gathering device", consente di selezionare un dispositivo alternativo, /dev/urandom, per la generazione di numeri casuali. La sua caratteristica pricipale è di non essere mai vuoto, generando sempre nuovi numeri casuali partendo dal pool di quelli esistenti.

Commenti:

Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon! What is Natto?

Inviato da: What is Natto? il: 2019-02-09 14:55:12.390241

Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates. Benefits of Turnips

Inviato da: Benefits of Turnips il: 2019-02-09 14:51:24.135548

Normally I do learn article on blogs. Your writing taste has been surprised me. Thanks, quite great article. Let's try to play run 3 game now.

Inviato da: Joseph il: 2017-11-01 09:37:11.881481

I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. Risks of Eating Tofu

Inviato da: Risks of Eating Tofu il: 2019-02-09 14:53:23.207449 This is really such a great informative post. Thank you for sharing with us, I too always learn something new from your post. keep doing a great work. Tillys Coupons

Inviato da: nora il: 2018-08-09 13:02:03.904785 I have read your blog and I think its very interesting. thanks for publishing this valuable blog.

Inviato da: Linenspa coupons il: 2019-01-09 12:34:25.614272 Please give some advice on how to achieve this kind of posts. process server

Inviato da: process server il: 2019-02-13 11:21:06.397396 Awesome article! I want people to know just how good this information is in your article. It’s interesting, compelling content. Your views are much like my own concerning this subject.

Inviato da: $1 web Hosting il: 2018-09-27 08:45:25.534776 I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks Salmon

Inviato da: Salmon il: 2019-02-09 14:52:56.511214 Great stuff! this is really a good article I am telling because of I read your article and I got know this is really a good article. I want to say thank you for giving an important stuff with a powerful point. I hope people love your article and give good feedback.

Inviato da: $1 Web Hosting il: 2018-09-27 08:42:02.746184 Je vous remercie de l'information! Je cherchais et ne pouvait pas trouver. Vous me aidé! 192.168.l.l

Inviato da: Sophie Miller il: 2018-08-15 11:41:20.706052 Buon articolo, informazioni molto interessanti.123movies

Inviato da: kerrmartel il: 2019-02-20 05:30:13.898427 I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. How to Lose Belly Fat For All Body Types

Inviato da: How to Lose Belly Fat For All Body Types il: 2019-02-09 14:54:48.123316 Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. How to Lose Weight Fast

Inviato da: How to Lose Weight Fast il: 2019-02-09 14:50:41.268371 Really your post is really very good and I appreciate it. It’s hard to sort the good from the bad sometimes.You definitely put a new spin on a topic thats been written about for years.

Inviato da: subway surfers il: 2018-07-10 10:38:19.415202 Messaggi che condividono informazioni interessanti, grazie per aver condiviso con noi.gomovies

Inviato da: berthadavis il: 2019-02-20 05:25:43.551572 The information you have shared with us is really interesting and useful. I hope you will continue posting such more amazing blog post.

Inviato da: $1 Web Hosting il: 2018-11-27 08:37:15.34945 Hello! I enjoy your time and effort you add engrossed. Maintain the nice work I would like facts like that. Thank you! chaga pilz tee kaufen

Inviato da: Joyce il: 2019-02-18 09:10:53.385433 Very nice blog. Thanks for share it

Inviato da: Computer Science Dissertation Writing Se il: 2019-01-23 12:06:32.994201 I am so awed with your innovative work and this inventive work is exceptionally valuable for you. This scrapbook is looking so lovely particularly the example of the scrapbook and check out assignmentmasters.co.uk review for well task. This is extremely astonishing bear the cost of that you did in this work and I thoroughly like this movement.

Inviato da: DavidHodges il: 2019-01-02 10:57:38.862229 Hey!! Thank you so much for sharing information about blog framaroot pingpong root Root Master

Inviato da: zolejohu il: 2018-12-17 06:59:57.39863 I frequently benefit from locating a site that gives you great ideas since I like being familiar with new stuff. Pleased when I came across your web blog because I greatly enjoyed this and so I anticipate your future article. An awesome web page and i'll return again for additional fantastic content… https://www.amarketingexpert.com/book-promotion-blog/

Inviato da: haris khan il: 2019-02-19 13:56:31.106488 The writer is enthusiastic about purchasing wooden furniture on the web and his exploration about best wooden furniture has brought about the arrangement of this article. tech blogs

Inviato da: tech blogs il: 2019-02-09 13:04:46.247377 Enter the result of the sum of 59 and 55

Inviato da: haris khan il: 2019-02-19 13:54:10.245774 Very good, I think I found the knowledge I needed. I will see and refer some information in your post. thank you. Putlocker, 123movies

Inviato da: Anna Shetty il: 2017-12-05 09:05:27.978133 I love the way you write and share your niche! Very interesting and different! Keep it coming! High Fiber Foods

Inviato da: High Fiber Foods il: 2019-02-09 14:54:20.713481 You have posted a very detail document. I read all of your article and I really like it, I understand your point of view.

Inviato da: Putlocker il: 2017-12-05 09:04:44.384503 I frequently benefit from locating a site that gives you great ideas since I like being familiar with new stuff. Pleased when I came across your web blog because I greatly enjoyed this and so I anticipate your future article. An awesome web page and i'll return again for additional fantastic content…

Inviato da: https://www.amarketingexpert.com/book-promotion-blog/ il: 2019-02-19 13:55:40.999883

Scrivi un commento:

Archivio