1

I was wondering about an algorithm that would take a bitstring as an input, shuffle it and output it. You could use a deterministic RNG to select pairs of bits to swap, using the seed as some sort of password, handing it to people to let them reconstruct the shuffling process. Is this a good idea? Has anyone already thought of this? If not, are there any flaws I would have to bear in mind? I'm a newbie to cryptography and I don't really know how to approach this.

Excuse my poor English grammar and thank you for your time!

EDIT: I forgot to specify that this is for learning purposes.

1 Answers1

1

They call this a transposition cipher. Bits commonly have more semantic meaning assembled into characters and numbers, so you may be performing fractionation specifically. Also, in cryptography we'd use a CSPRNG for the shuffle rather than a plain RNG for invertability reasons detailed in the link. Frequency analysis means that it's fairly easy to break though. Stuff to think about then.

It's a lot to take in, and there are very subtle nuances that mean creating a cipher from scratch is pretty tough. It's better to stick to library functions/ standardised methods /primitives in non scholarly uses. Hi!

Paul Uszak
  • 15,905
  • 2
  • 32
  • 83