Online PlayTable Security Code Calculation
by Jorbes
Moderators: Jorbes, CCGHQ Admins
Online PlayTable Security Code Calculation
by 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.
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.
Re: Online PlayTable Security Code Calculation
by Strainer » 05 Dec 2009, 13:33
Thanks for this, any plans on the next OPT update?
Re: Online PlayTable Security Code Calculation
by Jorbes » 05 Dec 2009, 16:30
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.Strainer wrote:Thanks for this, any plans on the next OPT update?
Re: Online PlayTable Security Code Calculation
by 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
by Jorbes » 05 Dec 2009, 23:54
No, it's impossible to calculate the string the md5 hash was created with.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!
Re: Online PlayTable Security Code Calculation
by 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
by Jorbes » 17 Feb 2010, 09:34
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?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.
Re: Online PlayTable Security Code Calculation
by SqFKYo » 17 Feb 2010, 15:58
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.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?
- SqFKYo
- Posts: 14
- Joined: 12 Feb 2010, 19:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Online PlayTable Security Code Calculation
by Jorbes » 17 Feb 2010, 20:36
Ok, i think i can cook something up tomorrow.SqFKYo wrote: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.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?
Re: Online PlayTable Security Code Calculation
by SqFKYo » 18 Feb 2010, 15:13
Sweet, thanks, no rush though, the event will take place in April .Jorbes wrote:Ok, i think i can cook something up tomorrow.
- SqFKYo
- Posts: 14
- Joined: 12 Feb 2010, 19:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Online PlayTable Security Code Calculation
by Jorbes » 18 Feb 2010, 15:32
It's on the homepage, let me know if that is what you can use.SqFKYo wrote:Sweet, thanks, no rush though, the event will take place in April .Jorbes wrote:Ok, i think i can cook something up tomorrow.
Re: Online PlayTable Security Code Calculation
by SqFKYo » 18 Feb 2010, 17:54
Looks like it's exactly what I needed, thanks .Jorbes wrote:It's on the homepage, let me know if that is what you can use.
- SqFKYo
- Posts: 14
- Joined: 12 Feb 2010, 19:46
- Has thanked: 0 time
- Been thanked: 0 time
12 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 31 guests