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

  • SEARCH
  • Home
  • 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 6777553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:09:41+00:00 2026-05-26T16:09:41+00:00

Imagine I was able to shuffle all numbers between 0 and 2^32 using something

  • 0

Imagine I was able to shuffle all numbers between 0 and 2^32 using something like the Knuth shuffle and a seeded random number generator seeded with a key.

Conceptually, I would need two arrays (using Z5 instead of Z232 for brevity):

[2, 0, 1, 4, 3] // perm
[1, 2, 0, 4, 3] // inv === p^-1

If I had these arrays, I could efficiently look up the nth element in the permutation as well as find out with element in the purmutation value v;

v = perm[n];
n == inv[v]; // true

I don’t want to store two 16 GB arrays of uint representing this shuffled set because I am never interested in the entire shuffled sequence at any time. I am only ever interested in the value of the nth element.

I ideally want to write two pure functions that work like this:

uint nthShuffled = permutate<uint>(key, n); // O(log n)
uint n == invert<uint>(key, nthShuffled); // O(log n)

Requirements:

  • Every 32 bit value maps to a unique different 32 bit value.
  • Knowldedge of the first 100 elements in the permutation provides no information on what might be the 101st element in the permutation.

I understand that in theory there must be at least 232! unique keys in order to represent any possible permutation, but I believe I can hide that problem in practice behind a good hashing function.

Is there anything out there that comes close to this?

  • 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-26T16:09:42+00:00Added an answer on May 26, 2026 at 4:09 pm

    Any block cipher is actually a pseudo-random permutation. A 32-bit block cipher permutates the integers between 0 and 2 ^ 32 - 1.

    Given a secret key, encrypting N with this key gives the N-th pseudo-random number.

    The only problem would be finding a good 32-bit block cipher. The only one I know is SKIP32, but I do not know anything about its strength.

    SKIP32’s key size is 80 bits. If it is a good cipher, that would be enough.

    But again, I do not know the cipher.

    If increasing the range to 2 ^ 64 - 1 integers is an option for you, you could simpply use a well-known 64-bit block cipher like Triple-DES or Blowfish.

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

Sidebar

Related Questions

Imagine a scenario where, using xml, the user is able to specify ranges in
I'd like to be able to display a mutable list (using Swing) such that
I would like to be able to decide where a sub view is placed,
I can't imagine this is hard to do, but I haven't been able to
I'd like to be able to project/map properties from either of 2 child classes.
Using Python I want to be able to draw text at different angles using
I'd like my program to be able to email me error reports. How can
imagine we have a client/server multiuser architecture. At any time a user is able
Some programs like ProcessExplorer are able to read strings in memory (for example, my
Some programs like ProcessExplorer are able to read strings in memory (for example, my

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.