Jump to content

Search the Community

Showing results for tags 'random numbers'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. RdRand is Intel's on-chip hardware random number generator using entropy. This is just a quick response to this query; a faster solution would be to integrate some inline assembly (maybe using fasm?) The dll source is written by Stephen Higgins (blog here); there are several alternative codes available on GitHub as well. Usage for encryption is controversial (there are rumours of an NSA backdoor), but it may provide the closest approach to TRNG using PRNG. This is the 32-bit unsigned version, producing an integer in range: 0 to (4GB-1). Example: ; for dll source, see: https://github.com/viathefalcon/rdrand_msvc_2010 ; NB only some Intel CPUs support this feature $RdRandsupported=_RdRandInit() MsgBox(0,"Is RdRand supported on this CPU?",$RdRandsupported) if $RdRandsupported=False then Exit Global $lowerbound=0 ; NB: negative values are returned as 4GB - value (unsigned int) Global $upperbound=1000 ConsoleWrite("RdRand lower bound: " & $lowerbound & @CRLF) ConsoleWrite("RdRand upper bound: " & $upperbound & @CRLF & @CRLF) For $rc=1 To 100 ConsoleWrite("RdRand: " & @TAB & _RdRand($lowerbound, $upperbound) & @CRLF) Next _RdRandCleanUp() ;################################################################################## Func _RdRandInit() Global $DllHandleRdRand = DllOpen(".\RdRandlib.dll") If @error Then Return SetError(1,0,False) $result=DllCall($DllHandleRdRand, "bool", "rdrand_supported" ) If @error Then Return SetError(1,0,False) Return ($result[0]=1) EndFunc Func _RdRandCleanUp() If IsDeclared($DllHandleRdRand) Then DllClose($DllHandleRdRand) EndFunc Func _RdRand($lower, $upper) $result=DllCall($DllHandleRdRand, "uint", "rdrand_uniform_ex", "uint", $lower, "uint", $upper ) if @error then Return SetError(@error,@extended,False) Return $result[0] EndFunc RdRand.7z
×
×
  • Create New...