Difference between revisions of "Piñata Vision barcode/Obfuscation set"

From PinataIsland.info, the Viva Piñata wiki
Jump to: navigation, search
m (Add links for decoded obfuscation sets)
m (Add links for decoded obfuscation sets)
Line 172: Line 172:
 
=== Decoded obfuscation sets ===
 
=== Decoded obfuscation sets ===
  
 +
* [[Piñata_Vision_barcode/Obfuscation_set/0|Obfuscation set 0]]
 
* [[Piñata_Vision_barcode/Obfuscation_set/1|Obfuscation set 1]]
 
* [[Piñata_Vision_barcode/Obfuscation_set/1|Obfuscation set 1]]
 
* [[Piñata_Vision_barcode/Obfuscation_set/2|Obfuscation set 2]]
 
* [[Piñata_Vision_barcode/Obfuscation_set/2|Obfuscation set 2]]
Line 203: Line 204:
 
!Set!!ID bit 11!!ID bit 10!!ID bit 9!!ID bit 8!!ID bit 7!!ID bit 6!!ID bit 5!!ID bit 4!!ID bit 3!!ID bit 2!!ID bit 1!!ID bit 0
 
!Set!!ID bit 11!!ID bit 10!!ID bit 9!!ID bit 8!!ID bit 7!!ID bit 6!!ID bit 5!!ID bit 4!!ID bit 3!!ID bit 2!!ID bit 1!!ID bit 0
 
|-
 
|-
|0||0s 1s||54 48||style="background:#00FF00;"|47||47 46 45||47 46 45||47 44||style="background:#00FF00;"|43||43 42 41||43 42 41||43 41 40||style="background:#00FF00;"|39||38 37
+
|0||style="background:#00FF00;"|50||54 48||style="background:#00FF00;"|47||47 46 45||47 46 45||47 44||style="background:#00FF00;"|43||43 42 41||43 42 41||43 41 40||style="background:#00FF00;"|39||38 37
 
|-
 
|-
 
|1||style="background:#00FF00;"|56||44 26||style="background:#00FF00;"|55||34 26 25||55 54||27 24||55 54 53||45 23||55 52||43 41 40||56 51 48||38 37
 
|1||style="background:#00FF00;"|56||44 26||style="background:#00FF00;"|55||34 26 25||55 54||27 24||55 54 53||45 23||55 52||43 41 40||56 51 48||38 37

Revision as of 20:35, 25 July 2010

Note: Some of this article is speculation, and is unproven.

The Piñata Vision barcode article discusses obfuscation (of the barcode) in general.

Obfuscation sets

It's possible that the obfuscation set is identified by the first and last byte of the barcode's first (bottom) row. Having examined several all 16 obfuscation sets ([0-9A-F]) for ID bits, each set sharing a common first and last byte seems to use the same columns for its obfuscated ID bits. (See the Choclodocus egg card article for an example of an obfuscation set's ID bit locations.)

Since the first and last byte of row 1 appears to be used as the obfuscation key, that leaves 56 60 bits for data (assuming the card only has one row).

(Note that some articles may still refer to older 2-character obfuscation set descriptions. References to sets such as 96 and C6 should be considered to refer to a single obfuscation set 6.)

Multi-row cards

It's unknown if each following row uses the same obfuscation, or whether or not all the following row's bits are dedicated to data. Further study should examine first and last bytes of row 2, to see if they happen to appear in the following table. If so, it might be possble that data is broken down into blocks of 56 bits, and obfuscated on a per-row basis.

Note: This section is out-of-date (since determining that the obfuscation key doesn't involve the leading byte).

Based on a glance at the leading and trailing byte of row 2, it doesn't seem to have anything in common with sets used by row 1. This makes sense, since a) it's more efficient to store/obfuscate 64 bits of useable data, and b) the data wouldn't call for additional overhead of a per-row obfuscation. Additional rows may solely contain data that's similarly obfuscated as row 1. (Has row 1's leading and trailing byte been obfuscated, or does row 1's obfuscation only involve the 56 data bits? Are all 64 bits of row 2 obfuscated, or are 63-60 and 03-00 in the clear?)

Based on the name example, it's possible that row 2 has its own trailing obfuscation byte (key), and is obfuscated independently of row 1.

Obfuscation set selection

The method of selecting an obfuscation for the card's data seems to involve the ID bits to some degree. See the ID table for a pattern/grouping of obfuscated cards. It's probable that not every type of card has an ID field, so one possibility is that the obfuscation is selected based on data that (directly?) follows the card type field, and that the ID field follows the card type field for certain types of cards.

Based on (PlaceTag card type) ID table cards, only 8 of the 16 obfuscation sets are used in selection of an obfuscation set for a particular card. To determine the correct obfuscation (set) for a card's data, the following bits are used from the ID field:

Set Condition 1 Condition 2 Condition 3
0 ID bit 7 == 0 ID bit 2 ^ ID bit 6 == 0 ID bit 8 ^ ID bit 4 ^ ID bit 2 ^ ID bit 0 == 0
8 ID bit 7 == 0 ID bit 2 ^ ID bit 6 == 0 ID bit 8 ^ ID bit 4 ^ ID bit 2 ^ ID bit 0 == 1
6 ID bit 7 ^ ID bit 6 == 0 ID bit 2 ^ ID bit 6 == 1 ID bit 8 ^ ID bit 4 ^ ! ID bit 0 == 0
F ID bit 7 ^ ID bit 6 == 0 ID bit 2 ^ ID bit 6 == 1 ID bit 8 ^ ID bit 4 ^ ! ID bit 0 == 1
4 ID bit 7 == 1 ID bit 2 ^ ID bit 6 == 0 ID bit 8 ^ ID bit 4 ^ ID bit 2 ^ ID bit 0 == 0
B ID bit 7 == 1 ID bit 2 ^ ID bit 6 == 0 ID bit 8 ^ ID bit 4 ^ ID bit 2 ^ ID bit 0 == 1
D ID bit 7 ^ ID bit 6 == 1 ID bit 2 ^ ID bit 6 == 1 ID bit 8 ^ ID bit 4 ^ ID bit 2 ^ ID bit 0 == 0
2 ID bit 7 ^ ID bit 6 == 1 ID bit 2 ^ ID bit 6 == 1 ID bit 8 ^ ID bit 4 ^ ID bit 2 ^ ID bit 0 == 1

Obfuscation set progression

ID + 0 Set A
ID + 1 Set B
ID + 2 Set A
ID + 3 Set B
ID + 4 Set C
ID + 5 Set D
ID + 6 Set C
ID + 7 Set D

As shown in the ID table, obfuscation sets appear to alternate in two groups of four. The following can be noted about the table:

  1. Although A, B, C, and D are placeholders, and don't refer to an actual obfuscation set, each group of four cards uses 2 different obfuscations.
  2. Within each group of four cards, the alternating cards appear to differ only by a single unobfuscated bit (e.g., ID bit 1).
  3. Although specific obfuscation sets may reappear in the following progression of eight cards, their order within their group of four might have alternated. (E.g., the first group may start as A, B, A, B, but eight cards later, their order may have changed to B, A, B, A.

Interpolation of obfuscation set data

Due to the repeating pattern of similarly obfuscated cards appearing 2 cards apart, and possibly 8 (or 9) cards apart, if the obfuscation set appears in the next progression, it's possible to interpolate data for missing cards, based on the pattern of differing obfuscated bits seen 2 (or 8) cards apart.

This can be done by comparing a pair of cards (from the same obfuscation set) to see which obfuscated bits differ. For example, (PlaceTag) cards for IDs 309 and 311 from obfuscation set 96 6 show the following minor difference (as the card's unobfuscated data changes ID bit 1 from 0 to 1, the barcode's obfuscated data changes bits 52 and 50 from 01 to 10):

egrep "(0309|0311)" 96_no_banjostatue.txt | ./bit_diff.pl 
                                             55
Description            VPID Barcode          20
-----------------------------------------------
Egg_walrus             0309 926EDF96E548F4A6 01  0x0135 0b0000000100110101
Egg_whitebutterfly     0311 927ADF96E548F4A6 10  0x0137 0b0000000100110111

ID bit  1 to match 01
  Exact match(es): 52, !50

Once a specific pattern is recognized, it can be used to fill in a missing card's barcode, based on the barcode from a similarly obfuscated card located 2 cards away. This comparison method can also be applied to cards located further (e.g., 8 or 32 cards) away, as long as they're from the same obfuscation set.

This process could even be automated by a script that scans the ID table, makes comparisons between alternating cards to recognize a particular obfuscation set's specific patterns, then applies that pattern to fill in missing ID table card barcodes.

List of obfuscation sets

The set count is based on unique barcodes (no duplicates).

The TroubleInParadise cards are wiki cards, and are not broken down by card type. The Other cards are wiki cards that don't match up with the image-naming convention.

Totaling the number of member cards may not match the count for various reasons:

  • Duplicate cards (e.g., card known by two names, such as Vision_Single_Placetag_Egg_dog and Barkbark-TroubleInParadise-Egg)
  • Omitted member cards (i.e., 010A22F91408B400D112.jpg from VivaPinata.com)

There appear to be 16 obfuscation sets.

Set Count Members
0 223 Appear_Cutscene (7) Blackariants (6) GoodVariants (6) Learn_Primary_Trick (6) Learn_Secondary_Trick (6) Mate_Cutscene (4) Other (23) Perform_Primary_Trick (5) Perform_Secondary_Trick (6) PlaceTag (69) RomanceMusic (1) TroubleInParadise (164) UnlockArt (7) ViewTagInJournal (11)
1 165 Appear_Cutscene (5) Blackariants (6) GoodVariants (7) House_Interior (1) Learn_Primary_Trick (4) Learn_Secondary_Trick (6) Mate_Cutscene (5) Other (29) Perform_Primary_Trick (7) Perform_Secondary_Trick (6) TroubleInParadise (139) UnlockArt (13) UnlockTag (3) ViewTagInJournal (6)
2 206 Appear_Cutscene (7) Blackariants (3) GoodVariants (5) Learn_Primary_Trick (7) Learn_Secondary_Trick (7) Mate_Cutscene (7) Other (15) Perform_Primary_Trick (6) Perform_Secondary_Trick (6) PlaceTag (67) RomanceMusic (1) TroubleInParadise (154) UnlockArt (5) ViewTagInJournal (6) Weather (1)
3 151 Appear_Cutscene (6) Blackariants (5) GoodVariants (11) House_Interior (1) Learn_Primary_Trick (6) Learn_Secondary_Trick (6) Mate_Cutscene (6) Other (19) Perform_Primary_Trick (6) Perform_Secondary_Trick (7) TimeWarp (1) TroubleInParadise (129) UnlockArt (7) ViewTagInJournal (5) Weather (1)
4 209 Appear_Cutscene (13) Blackariants (2) GoodVariants (9) Learn_Primary_Trick (7) Learn_Secondary_Trick (6) Mate_Cutscene (6) Other (18) Perform_Primary_Trick (6) Perform_Secondary_Trick (6) PlaceTag (62) TroubleInParadise (160) UnlockArt (7) ViewTagInJournal (9) Weather (2)
5 146 Appear_Cutscene (3) Blackariants (8) GoodVariants (4) Learn_Primary_Trick (4) Learn_Secondary_Trick (6) Mate_Cutscene (6) Other (25) Perform_Primary_Trick (7) Perform_Secondary_Trick (4) RomanceMusic (1) TroubleInParadise (122) UnlockArt (9) ViewTagInJournal (9)
6 205 Appear_Cutscene (6) Blackariants (5) GoodVariants (4) Learn_Primary_Trick (8) Learn_Secondary_Trick (7) Mate_Cutscene (7) Other (20) Perform_Primary_Trick (6) Perform_Secondary_Trick (8) PlaceTag (65) RomanceMusic (1) TimeWarp (1) TroubleInParadise (144) UnlockArt (7) ViewTagInJournal (5) Weather (4)
7 161 Appear_Cutscene (5) Blackariants (11) GoodVariants (4) Learn_Primary_Trick (4) Learn_Secondary_Trick (6) Mate_Cutscene (5) Other (24) Perform_Primary_Trick (4) Perform_Secondary_Trick (6) RomanceMusic (1) TroubleInParadise (136) UnlockArt (7) UnlockTag (3) ViewTagInJournal (8) Weather (1)
8 222 Appear_Cutscene (9) Blackariants (4) GoodVariants (7) Learn_Primary_Trick (5) Learn_Secondary_Trick (4) Mate_Cutscene (10) Other (24) Perform_Primary_Trick (7) Perform_Secondary_Trick (7) PlaceTag (65) RomanceMusic (1) TimeWarp (1) TroubleInParadise (160) UnlockArt (11) ViewTagInJournal (6)
9 159 Appear_Cutscene (7) Blackariants (10) GoodVariants (11) Learn_Primary_Trick (6) Learn_Secondary_Trick (7) Mate_Cutscene (5) Other (18) Perform_Primary_Trick (5) Perform_Secondary_Trick (4) RomanceMusic (3) TroubleInParadise (137) UnlockArt (7) UnlockTag (4) ViewTagInJournal (10)
A 123 Appear_Cutscene (9) Blackariants (5) GoodVariants (4) Learn_Primary_Trick (6) Learn_Secondary_Trick (8) Mate_Cutscene (7) Other (17) Perform_Primary_Trick (4) Perform_Secondary_Trick (6) RomanceMusic (1) TroubleInParadise (107) UnlockArt (7) ViewTagInJournal (2)
B 216 Appear_Cutscene (6) Blackariants (11) GoodVariants (5) Learn_Primary_Trick (6) Learn_Secondary_Trick (4) Mate_Cutscene (7) Other (25) Perform_Primary_Trick (8) Perform_Secondary_Trick (5) PlaceTag (68) TroubleInParadise (156) UnlockArt (10) ViewTagInJournal (9) Weather (1)
C 147 Appear_Cutscene (9) Blackariants (7) GoodVariants (7) Learn_Primary_Trick (7) Learn_Secondary_Trick (7) Mate_Cutscene (6) Other (19) Perform_Primary_Trick (4) Perform_Secondary_Trick (4) TroubleInParadise (128) UnlockArt (8) ViewTagInJournal (6) Weather (3)
D 241 Appear_Cutscene (7) Blackariants (5) GoodVariants (10) Learn_Primary_Trick (6) Learn_Secondary_Trick (6) Mate_Cutscene (7) Other (27) Perform_Primary_Trick (7) Perform_Secondary_Trick (8) PlaceTag (67) RomanceMusic (1) TroubleInParadise (174) UnlockArt (11) ViewTagInJournal (10) Weather (1)
E 151 Appear_Cutscene (9) Blackariants (10) GoodVariants (7) Learn_Primary_Trick (7) Learn_Secondary_Trick (5) Mate_Cutscene (10) Other (18) Perform_Primary_Trick (6) Perform_Secondary_Trick (7) TroubleInParadise (131) UnlockArt (11) UnlockTag (2) ViewTagInJournal (6) Weather (3)
F 204 Appear_Cutscene (9) Blackariants (4) GoodVariants (14) Learn_Primary_Trick (6) Learn_Secondary_Trick (4) Mate_Cutscene (6) Other (15) Perform_Primary_Trick (5) Perform_Secondary_Trick (5) PlaceTag (65) RomanceMusic (1) TimeWarp (1) TroubleInParadise (155) UnlockArt (7) ViewTagInJournal (9) Weather (1)

Decoding

Decoded obfuscation sets

Obfuscation method

Each obfuscation set stores their ID bits in the same columns. (See the Choclodocus egg card article for an example of ID bit diff results.) It's likely that all types of cards share the same obfuscation, although only the ID bit columns have been identified so far across all the obfuscation sets.

It's not known yet if the obfuscation method is based on a formula (i.e., the different sets have a common method of obfuscation), or a lookup table (i.e., the different sets are independently obfuscated and have nothing in common). A similar (rotated) pattern can be found among a few of the obfuscation sets, so it's possible that the different sets share a common manner of obfuscation.

Other patterns can be observed within a single obfuscation (e.g., set 1 appears to progress from 51 to 56 every other bit, set 2 appears to progress from 55 to 58 every three bits).

Progressions for decoded columns

  • D ? → ? → 61 → 5 6 7 → 7 → 9 10 11 → ~11 → 13 14 15 → 15 → ? → 19 → 21 22 23
  • C 7 → 9 10 11 → ~11 → 13 14 15 → ~15 → 17 18 19 → ~19 → ~21 22 23 → 23 → 25 26 27 → ~27 → ?
  • B 11 → 13 14 15 → 15 → 17 18 19 → 19 → 21 22 23 → 23 → 25 26 27 → 27 → 29 30 31 → 31 → 33 34 35
  • F 15 → ? → 17 18 19 → 19 → 21 22 23 → 23 → 25 26 27 → 27 → 29 30 31 → 31 → 33 34 35 → 35

Decoded columns for ID bits

Set ID bit 11 ID bit 10 ID bit 9 ID bit 8 ID bit 7 ID bit 6 ID bit 5 ID bit 4 ID bit 3 ID bit 2 ID bit 1 ID bit 0
0 50 54 48 47 47 46 45 47 46 45 47 44 43 43 42 41 43 42 41 43 41 40 39 38 37
1 56 44 26 55 34 26 25 55 54 27 24 55 54 53 45 23 55 52 43 41 40 56 51 48 38 37
2 28, 19 58, 8 60 38 19 17 57, 37, 7 39 38 37 19 18 56 39 38 36 19 18 17 16 55, 52 35, 22
3 13 60 48 36 24 14 59, 12 59, 12 47 35 23,20 11 59 58 57
4 62 55 52 43 34 26 18 9 62 60 51 59 42 41 8 33 62 26 25 24
6 47 44 37 35 32 27 25 23 22 18 17 62 59 49 15 12 7 62 55 50 43
8 14 12 14, 12, 10 9 61, 7 0s 1s 53, 44, 37 56, 50 45 48, 42 53, 44, 37 40, 34 36, 30
B 35 34 33 31 30 31 29 27 27 26 25 23 23 22 21 19 19 18 17 15 15 14 13 11
C 0s 1s 33 27 27 26 25 23 23 21 41 19 19 18 17 62 60 15 15 14 13 41 11 11 10 9 44 7
D 23 22 21 19 54 18 17 15 15 14 13 37 11 11 10 9 7 7 6 5 61 59 37 57 56 37
E 0s 1s 61 34 31 61 29 46 42 27 27 26 25 23 9 23 22 21 58 56 23 22 20 19 15 18 17 16 19 18 17
F 35 35 34 33 31 31 30 29 27 27 26 25 23 23 22 21 19 19 18 17 61 19 16 15