[squeak-dev] Re: [Cryptography port to Pharo] RandomGenerator class>>unpredictableStringsDo:

Robert Withers robert.w.withers at gmail.com
Sun Oct 18 08:59:45 UTC 2015


I'm sorry, I forgot the code. I list the existing method, followed by my 
modified Pharo method below. I welcome any feedback.

Regards,
Robert

---
Existing:
unpredictableStringsDo: aBlock
	"Enumerate sources of information from my environment that should be 
generally hard to guess."
	| time |
	time := Time millisecondsToRun:
		[ aBlock
			value: World imageForm bits compressToByteArray ;
			value: Sensor mousePoint x asString ;
			value: Sensor mousePoint y asString ;
			value: Time millisecondClockValue asByteArray ;
			value: Date today asString ;
			value: Time now asString ;
			value: Display extent asString.
		100 timesRepeat: [ aBlock value: UUID new ].
		#(vmVersion platformName primVmPath imageName platformSubtype 
datedVersion lastQuitLogPosition vmStatisticsReportString imageName) 
collect:
			[ : each |
			aBlock value: (SmalltalkImage current perform: each) asByteArray ] ].
	aBlock
		value: time asByteArray;
		"maybe the pointer has moved, hit it again."
		value: Sensor mousePoint asString ;
		value: Time millisecondClockValue asByteArray

---
Pharo port:
unpredictableStringsDo: aBlock
	"Enumerate sources of information from my environment that should be 
generally hard to guess."

	| time |
	time := Time millisecondsToRun:
		[ aBlock
			value: Time millisecondClockValue asByteArray ;
			value: Date today asString ;
			value: Time now asString.
		100 timesRepeat: [ aBlock value: UUID new ].
		#(version primImagePath imagePath datedVersion lastQuitLogPosition) 
collect:
			[ : each |
			aBlock value: (SmalltalkImage current perform: each) asByteArray ] ].
	aBlock
		value: time asByteArray;
		value: Time millisecondClockValue asByteArray


On 10/18/2015 04:23 AM, Robert Withers wrote:
> This is a message intended for anyone who was on the Cryptography team.
> I recently ported it to Pharo and had to make changes to RandomGenerator
> class>>unpredictableStringsDo:. This certainly removed some uncertainty
> from the results of this message. My question is what should I do about
> that? This method seems to require non-headless, as it is checking the
> mouse point and such. This being a crypto cornerstone, what the best
> answer here.
>
> Thank you,
> Robert


More information about the Squeak-dev mailing list