Or was there some way of assigning bit values to the cards? I left it out of my suggestion, because I couldn't remember how to do it.
You probably could but it would be tedious. I never came up with any such system. At some point one needs to trust something. Still if one absolutely needed to generate the private key by hand only then the simplest (although not the most efficient) would be to just look at the suits but it would require at least 3 (4 is probably better) passes through the deck.
It is possible to assign a bit value to permutations, but I couldn't tell you exactly how to do it. You can't assign bit values directly to cards (at least in the way I'm thinking), because 52^52 > 2^256. It is very similar to
Project Euler's Problem 24. By analogy for a 3-card deck: assign each permutation a number value.
1: 012
2: 021
3: 102
4: 120
5: 201
6: 210
Represent this as a 3-bit value. That's your private key, with ~2.6 bits of entropy. This analogy can also show you why a straightforward conversion like "represent each card as a base 3 digit in the number, then convert to binary" won't work: 222_3 = 26, which would require 5 bits to store in binary, not just 3.
If you use permutations of a deck of cards you get 52! possibilities which is <2^256. You need a few more cards.
To convert a given permutation to a number with a pen and paper you can do this using 1 2 0 as en example
- go from left to right, write the digit you see and then change the number to the right by subtracting 1 to every number that is greater than that digit
1 2 0 -> first digit 1, rest is 2 0 -> write 1, update the rest to 1 0 -> now we have 1 1 0
1 1 0 -> second digit is 1, rest is 0 -> write 1, the rest doesn't change -> final list 1 1 0
- ditch the last digit => now we have 1 1
- keep an accumulator. set it to 0 => acc = 0
- go left to right, pair the digit with a counter that starts at the length of the list (here 2) and decrements by 1 =>
+ every step, sum the digit with the acc and multiply by the counter
+ store the result in the acc
=> step 1: acc = 0, cnt = 2, digit = 1 => acc = 0 + 2*1 = 2
=> step 2: acc = 2, cnt = 1, digit = 1 => acc = 2 + 1*1 = 3
The final value of your acc is your permutation number.
perm :: [Int] -> [Int]
perm [] = []
perm (top:rest) = top:perm [if x>top then x-1 else x|x <-rest]
permN :: [Int] -> Int
permN deck =
let trim = init(perm deck)
n = length trim
in foldl (\acc (c,d) -> (acc+d)*c) 0 (zip [n,n-1..1] trim)