RSS Newsfeed

FASC-N Question
Return to FASC-N Solution

trustbearer-FASC-N-question.txt.zip

FASC-N Question
===============

The Federal Agency Smart Credential Number (FASC-N) is an identifier used as the primary identification string on all government issued credentials. (see sections 6.2-6.3, pages 25-28, of the TIG-SCEPACS for reference). The decoded form of a FASC-N value consists of a "start sentinel" (left bracket "["), some decimal digits, some "field separators" (dash "-"), and an "end sentinel" (right bracket "]"). These characters are mapped to sequences of five bits to form the encoded representation of the FASC-N; see the attached documentation for exactly how this is done. Because these values are meant to be encoded on magnetic stripes, error checking is present in each one of the encoded characters' bitstrings, and also for the encodedbitstring as a whole: the final five-bit sequence (the LRC {ed. note: in the original it calls it an "LRC byte" but it's not a byte, just fivebits}) is specially constructed based on the other bitstrings. The resultant 25-byte encoded bit sequence can be hex-encoded as shown below.

Definitions for this question:
Field separator = FS = -
Start sentinel = SS = [
End sentinel = ES = ]

Example from TIG-SCEPACS (sanity check):
Note: The large binary string given in the example (the one without spaces) is missing a bit.
Decoded: [0032-0001-092446-0-1-1112223333112232]
Encoded: D0 43 94 58 21 0C 2C 19 A0 84 6D 83 68 5A 10 82 10 8C E7 39 84 10 8C A3 FC
Binary: 11010 00001 00001 11001 01000 10110 00001 00001 00001 10000 10110 00001 10011 01000 00100 00100 01101 10110 00001 10110 10000 10110 10000 10000 10000 01000 01000 01000 11001 11001 11001 11001 10000 10000 01000 01000 11001 01000 11111 11100

Another example:
Decoded: [1111-2222-333333-4-5-6666666666666666]
Encoded: D4 21 08 59 08 42 2D 9C E7 39 CD 89 6A D9 AD 6B 5A D6 B5 AD 6B 5A D6 B7 E2
Binary: 11010 10000 10000 10000 10000 10110 01000 01000 01000 01000 10110 11001 11001 11001 11001 11001 11001 10110 00100 10110 10101 10110 01101 01101 01101 01101 01101 01101 01101 01101 01101 01101 01101 01101 01101 01101 01101 01101 11111 00010

In the language of your choice write a FASC-N encoder / decoder to convert between the decoded format and the hex-encoded representation. After your program is complete:

1. Encode the following FASC-N as 25 bytes (including calculating the LRC)
[7099-0010-000145-1-4-0000036068170992]
2. Decode the following 25 bytes as a FASC-N:
D4 02 10 DA 01 08 6D 04 64 95 6D B9 61 5A 61 08 42 19 8B 8D A9 32 88 07 F3



Copyright © 2005
Site Validation  menu by Milonic v5.803