CribbageStreet

Deals you can check

Before the first card of an online game, the server seals its shuffle. Your phone adds a seed of its own. When the game is over the seed comes out, and every deal can be shuffled again: on your phone, and here.

The same shuffle as the game, run in this pageNothing you paste leaves your browser

From the app’s Deal seal sheet, one value at a time. Nothing you paste leaves this page.

First deal
Paste the four values, then Check the deals. Or try the example.
What you getthe seal opened, then every deal as it was dealt.

Paste the four values from the sheet and the page checks that the server seed hashes to the seal, then shuffles each deal again exactly as the game did and shows both hands as dealt. Open the game’s Review in the app beside it and compare, deal by deal.

Seal, shown before the first deal802b02763db891e5803d8c10cec040ae892ef06efbd9aa5c4acfe7fd050d4c53
A 9-deal game between you and Ana.

What the seal is

  1. 1
    Before the first deal

    The server draws a secret seed and shows its SHA-256 hash: the seal. The app shows “Sealing the deals” while this happens. The seal fixes the server’s part of every shuffle before a card is dealt.

  2. 2
    Then each phone adds a seed

    Your phone sends a seed of its own after it has seen the seal, and so does the other player’s. Every deck of the game is cut from the three together, so the server could not choose the order on its own, and neither phone could, since the server’s part was fixed first.

  3. 3
    When the game is over

    The server shows its seed. Your phone checks that it hashes to the seal, shuffles every deal again from the three seeds, and checks each card it saw against its place in that deck. The result card says “Deal seal: all 9 deals match”, and one tap opens the sheet with every value.

This page does the same check with the same code. The engine that shuffles on the server runs here too, so a deal that matches on your phone matches here.

Why it can be trusted

The server deals, so it knows every card. The seal shows that it did not pick them: a hash cannot be worked backwards, and a different seed would give a different seal. Your seed arrives after the seal, so the server cannot have planned around it, and you cannot steer the deck either, because the server’s half is already fixed. The deck order is as good as the seeds together, and either of you can make yours anything at all.

What the seal cannot do is tell you who the other player is, or watch the play. It covers the cards: which ones each of you was dealt, and which one turned up when the pack was cut.

How a deck is built from the seeds

The recipe is short enough to redo with any HMAC-SHA256 tool, which is why the app says so on its sheet. This is the engine’s own description of it, from its source:

  HMAC-SHA256(key = serverSeed bytes,
              message = clientSeeds.join(":") + ":" + h + ":" + block)

for block = 0, 1, 2, ... (32 bytes each), fed to a Fisher-Yates shuffle of
the 52 cards in id order:

  for i = 51 down to 1:
    n = i + 1; take the next byte b, skipping any b >= 256 - (256 % n);
    j = b % n; swap deck[i] and deck[j]

Skipping the high bytes keeps every position equally likely, so every order of the 52 cards is. Deal 0 is the cut for the first deal: each player takes a card in turn from that deck and the lower rank deals. Deal 1 is the first hand: 6 cards each, the player who did not deal first, one at a time, and the 40 left are the pack the non-dealer cuts for the starter.

Where the app shows it

At the end of an online game the result card carries the line “Deal seal: all 9 deals match”. Tap it and the Deal seal sheet opens: the seal shown before the first deal, your phone’s seed, the other player’s seed, the server seed, and the verdict. Each value can be selected and copied. A finished game’s Review, under History, has the same line and the same sheet.

If a check fails

The sheet says “The server seed does not open the seal.” or “Deal 4 does not match.” in red, and the result card says “Deal seal: the check failed”. Write to [email protected] with the game’s date and the sheet’s values.

Games against the computer

A game on your phone against the computer has a seal too. Before the first deal the app seals the shuffle, a hash of the seed it cuts every deal from; the computer plays from its own cards and never reads the deck. When the game is over the sheet shows the seal and the seed, and your phone shuffles every deal again from it and checks each card you saw. Paste those two here and the page checks that the seed opens the seal. Redoing the deals themselves needs the two phone seeds the sheet does not show yet; the phone’s own check covers them.

The Daily discard

The Daily discard needs no seal: its six cards come from the date itself, so every phone and this site deal the same six for the same day, with no server involved.

What the check does not cover

  • Where the pack was cut for the starter. The non-dealer chooses, at the table; the page lists the pack in order so you can find the card at the depth you cut.
  • Deals your phone was away for. The sheet says “This phone was away for deal 4.” when a reconnection skipped one; this page can still redo them.
  • The play itself: which cards were laid and what was pegged. The Review shows that.

Every online game ends with its seal.

The result card says whether all the deals match, and one tap shows every value. Bring them here, or to any HMAC-SHA256 tool.

Google PlayFree downloadApp StoreComing soon