It is currently 25 Apr 2024, 04:49
   
Text Size

Online PlayTable Security Code Calculation

Moderators: Jorbes, CCGHQ Admins

Online PlayTable Security Code Calculation

Postby Jorbes » 05 Dec 2009, 12:25

EDIT:

forgot to mention that
-the amount of "cardname" is also a factor
-the final string is actually the base64 string representation of the md5 hash, because the hash is just an array of bytes.
also changed step 1 with 2, because getting rid of basic land is pretty much the thing to do first.

In case you would need to calculate this for yourself, here is how to do that.

Take the deck:

2 Aa2
3 Plains
1 Ee3
5 Swamp
2 dD!
1 bB?
SB: 3 C_c

1.) remove all basic land

2 Aa2
1 Ee3
2 dD!
1 bB?
SB: 3 C_c

2.) Merge sideboard and maindeck into one list. Keep in mind that when you have more than 1 of a given card, say N, you need to have that card N times in this list (or you can do this when you do step 6)

Aa2
Aa2
Ee3
dD!
dD!
bB?
C_c
C_c
C_c

3.) convert all cardsnames to uppercase

AA2
AA2
EE3
DD!
DD!
BB?
C_C
C_C
C_C

4.) strip from all cardnames all characters besides 'A'..'Z'

AA
AA
EE
DD
DD
BB
CC
CC
CC

5.) sort this list of cardsnames (culture doesn't matter, because it's A..Z only)

AA
AA
BB
CC
CC
CC
DD
DD
EE

6.) concatenate all cardnames into one string

AAAABBCCCCCCDDDDEE

7.) take the MD5 hash of this string

some array of bytes

8.) convert this array of bytes to it's base64 representation

some string consisting of a..z, A..Z, 0..9, +, / and = as the filler character

9.) take the first 10 characters of this hash value.

Done!

Note:

This method means that sideboarding does not change the code.
This also means that one could potentially sideboard before game 1 of a match if one would want to cheat and one would have knowledge of the deck his/her opponent is playing and knows how to get an unfair advantage.

However, I have chosen this method because of
a.) the code doesn't change
b.) post game1 sideboarding is much more important than pre game1 "cheating"

Also keep in mind that these codes will eventually become obsolete when the server takes care of the decks for the players and players actually need to do the sideboarding on the server (there may be an offline->board->connect->submit feature in there somewhere). This way pre game1 sideboarding and other illegal deck manipulation will become impossible and checks made by players will no longer be needed so they can just focus on the actual game.

Thanks for reading!

Jorbes.
Jorbes
DEVELOPER
 
Posts: 333
Joined: 10 Oct 2008, 10:46
Has thanked: 0 time
Been thanked: 2 times

Re: Online PlayTable Security Code Calculation

Postby Strainer » 05 Dec 2009, 13:33

Thanks for this, any plans on the next OPT update?
Strainer
 
Posts: 64
Joined: 02 Oct 2009, 09:28
Has thanked: 13 times
Been thanked: 12 times

Re: Online PlayTable Security Code Calculation

Postby Jorbes » 05 Dec 2009, 16:30

Strainer wrote:Thanks for this, any plans on the next OPT update?
After the dust clears probably, I've got too much stuff to take care of at the moment, but I find an hour here and there.
Jorbes
DEVELOPER
 
Posts: 333
Joined: 10 Oct 2008, 10:46
Has thanked: 0 time
Been thanked: 2 times

Re: Online PlayTable Security Code Calculation

Postby kburts » 05 Dec 2009, 23:30

would there be a way to reverse this, so that you could find out what deck your opponent was using? because I think that would be a pretty big advantage!
kburts
 
Posts: 15
Joined: 29 Jul 2009, 19:09
Has thanked: 0 time
Been thanked: 0 time

Re: Online PlayTable Security Code Calculation

Postby Jorbes » 05 Dec 2009, 23:54

kburts wrote:would there be a way to reverse this, so that you could find out what deck your opponent was using? because I think that would be a pretty big advantage!
No, it's impossible to calculate the string the md5 hash was created with.
Jorbes
DEVELOPER
 
Posts: 333
Joined: 10 Oct 2008, 10:46
Has thanked: 0 time
Been thanked: 2 times

Re: Online PlayTable Security Code Calculation

Postby SqFKYo » 16 Feb 2010, 18:06

Is it possible to calculate the md5 hashes somehow for larger amount of decks instead of loading them one by one into the game module? I'm planning to run a sealed event, and I'm not sure if the only way to make sure that nobody cheats is for me to prepare the sealed pools beforehand (generate & check the md5 sums), and then assign them to players at the event.
SqFKYo
 
Posts: 14
Joined: 12 Feb 2010, 19:46
Has thanked: 0 time
Been thanked: 0 time

Re: Online PlayTable Security Code Calculation

Postby Jorbes » 17 Feb 2010, 09:34

SqFKYo wrote:Is it possible to calculate the md5 hashes somehow for larger amount of decks instead of loading them one by one into the game module? I'm planning to run a sealed event, and I'm not sure if the only way to make sure that nobody cheats is for me to prepare the sealed pools beforehand (generate & check the md5 sums), and then assign them to players at the event.
You would like a tool that allows you to open any number of decklists and see the OPT Sec Code for all of them at once?
Jorbes
DEVELOPER
 
Posts: 333
Joined: 10 Oct 2008, 10:46
Has thanked: 0 time
Been thanked: 2 times

Re: Online PlayTable Security Code Calculation

Postby SqFKYo » 17 Feb 2010, 15:58

Jorbes wrote:You would like a tool that allows you to open any number of decklists and see the OPT Sec Code for all of them at once?
Exactly, this would allow the tournament organizer (= me) to generate number of sealed pools in advance, and then check their codes before giving them to the participants with ease.
SqFKYo
 
Posts: 14
Joined: 12 Feb 2010, 19:46
Has thanked: 0 time
Been thanked: 0 time

Re: Online PlayTable Security Code Calculation

Postby Jorbes » 17 Feb 2010, 20:36

SqFKYo wrote:
Jorbes wrote:You would like a tool that allows you to open any number of decklists and see the OPT Sec Code for all of them at once?
Exactly, this would allow the tournament organizer (= me) to generate number of sealed pools in advance, and then check their codes before giving them to the participants with ease.
Ok, i think i can cook something up tomorrow.
Jorbes
DEVELOPER
 
Posts: 333
Joined: 10 Oct 2008, 10:46
Has thanked: 0 time
Been thanked: 2 times

Re: Online PlayTable Security Code Calculation

Postby SqFKYo » 18 Feb 2010, 15:13

Jorbes wrote:Ok, i think i can cook something up tomorrow.
Sweet, thanks, no rush though, the event will take place in April :).
SqFKYo
 
Posts: 14
Joined: 12 Feb 2010, 19:46
Has thanked: 0 time
Been thanked: 0 time

Re: Online PlayTable Security Code Calculation

Postby Jorbes » 18 Feb 2010, 15:32

SqFKYo wrote:
Jorbes wrote:Ok, i think i can cook something up tomorrow.
Sweet, thanks, no rush though, the event will take place in April :).
It's on the homepage, let me know if that is what you can use.
Jorbes
DEVELOPER
 
Posts: 333
Joined: 10 Oct 2008, 10:46
Has thanked: 0 time
Been thanked: 2 times

Re: Online PlayTable Security Code Calculation

Postby SqFKYo » 18 Feb 2010, 17:54

Jorbes wrote:It's on the homepage, let me know if that is what you can use.
Looks like it's exactly what I needed, thanks :).
SqFKYo
 
Posts: 14
Joined: 12 Feb 2010, 19:46
Has thanked: 0 time
Been thanked: 0 time


Return to Online PlayTable

Who is online

Users browsing this forum: No registered users and 16 guests


Who is online

In total there are 16 users online :: 0 registered, 0 hidden and 16 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 16 guests

Login Form