Playing around with some ideas for a hash-function using simple primitives, I came up with this construction:
Select two large safe primes, $B$ and $M$, where $B < M$. Define $C$ as the concatenation of key $K$ (a passphrase) with any number of salt/nonce parameters $S_i$, where each field is separated by the ASCII "field separator" character $\mathbb{0x1e}$.
Now construct hash $H$ by repeating the following steps:
Set $E$ to be the repeated concatenation of $C$ such that $M < E$, where each copy of $C$ is separated by the ASCII "record separator" character $\mathbb{0x1c}$.
Calculate $R$ as $B^E \bmod M$.
Starting from the last digits of $R$:
a. Extract 8 bits and "move backward" that many steps + 1.
b. Extract 4 bits and append to $H$.
c. If the length of $H$ is sufficient, we are done.
d. Repeat until we have "reached the beginning" of $R$.
Set $C$ to the current value of $R$.
Go back to step 1.
As far as I can tell, the algorithm seems to satisfy all of the requirements of a CPRNG, such as first and second preimage-resistance, collision-resistance, etc.
The questions I have specifically are
- if it does indeed guarantee such a thing?
- are there any similar methods being used today?