Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6376187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:42:46+00:00 2026-05-25T01:42:46+00:00

Is there a simple Windows equivalent for this bash command: head -c 500 /dev/urandom

  • 0

Is there a simple Windows equivalent for this bash command:

head -c 500 /dev/urandom | tr -dc abcdefghijklmnopqrstuvwxyz | head -c 9; echo

I think the main problem is /dev/urandom, since I’ve heard of the CryptoAPI, but I don’t know if that’s cryptographically secure enough.

EDIT: Sorry, the code is used in a php script, and the %s represents a string substitution; I forgot to make that substitution when I asked the question. Fixed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:42:47+00:00Added an answer on May 25, 2026 at 1:42 am

    Taken from RFC 4086:

    7.1.3. Windows CryptGenRandom

    Microsoft’s recommendation to users of the widely deployed Windows
    operating system is generally to use the CryptGenRandom pseudo-random
    number generation call with the CryptAPI cryptographic service
    provider. This takes a handle to a cryptographic service provider
    library, a pointer to a buffer by which the caller can provide
    entropy and into which the generated pseudo-randomness is returned,
    and an indication of how many octets of randomness are desired.

    The Windows CryptAPI cryptographic service provider stores a seed
    state variable with every user. When CryptGenRandom is called, this
    is combined with any randomness provided in the call and with various
    system and user data such as the process ID, thread ID, system clock,
    system time, system counter, memory status, free disk clusters, and
    hashed user environment block. This data is all fed to SHA-1, and
    the output is used to seed an RC4 key stream. That key stream is
    used to produce the pseudo-random data requested and to update the
    user’s seed state variable.

    Users of Windows “.NET” will probably find it easier to use the
    RNGCryptoServiceProvider.GetBytes method interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using unmanaged C++ on a Windows platform, is there a simple way to detect
On Windows, testing different OSes is made simple using VMs. Is there a simple
I have a binary file - Windows static library (*.lib). Is there a simple
ANSWER: There isn't a natively managed equivalent for this method. However, a good example
I have problem installing simple Windows Service, my code looks like this: using System;
I'm trying to make a simple Windows Phone 7 Silverlight app. There's the MainPage.xaml
Let's say in a simple windows form there is a Webbrowser control that points
Is there a simple way to run a Python script on Windows/Linux/OS X? On
In a simple app I'm working on, I've got three related assemblies: MyCompany.Geography.Windows.Forms which
Are there simple libraries out there (.NET and Java) that are able to validate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.