Use Card Number Conversion
Card conversion can be used for translating of card reader output (the data reader gets after user swipes a card) to card number stored in user database (LDAP, AD, YSoft SafeQ, etc.) if these two numbers are different.
Use Card manager editor only if you are unable to login with card and Terminal access page or log files lists different card numbers than your card has.
More card number pairs you enter, more exact result you get. You should enter at least three different pairs to get valid result.
Conversion Function
SafeQ Support conversions of card numbers as read by Card Reader at Terminal or by LDAP Replicator. If conversion function is defined, card numbers are automatically transformed prior matching with (or storing to) SafeQ Identity Database.
Typical conversion configuration looks as follows and is represented by conversion attribute in SafeQ configuration:
ASCII2Hex;Hex2Dec;Substring(-8)
Each rule is represented by its name (see description of rules) and separated by semicolon. Some rules have one or two parameters which are in parentheses and separated by comma.
Substring(2);Hex2Dec;LeftPadding(0,3) + Substring(2,6);Hex2Dec
Some conversions may contain two (or more) independent conversion rules that are connected by operator +.
The conversion is executed from the left, rule by rule. Each conversion rule takes the last converted number and executes. Where operator + appears it takes the output from a preceding rule, executes the rules in parallel and returns the result of both rules. The result in the case of operator + may look as follows: Conversion rule: LeftPadding(0,3) + Substring(2,6) INPUT: 1a2b3c4d OUTPUT: (1a2b3c4d) + (2b3c) = 1a2b3c4d2b3c
Description of Rules
Following rules are sorted alphabetically.
Please note that rule names are CASE SENSITIVE.
ASCII2Hex | This rule converts string in ASCII format (typically from KM reader) into hex form. Other input is not changed. ASCII format is "^([34][0-9])+([fF]{2})*$"
|
Bin2Dec | Converts number from binary format into decimal format.
|
Const | Returns specified string. Could be used with operator +. Similar functionality provides LeftAppend and RightAppend.
|
Dec2Bin | Converts number from decimal format into binary format.
|
Dec2Hex | Converts number in decimal format into hexadecimal format
|
DecimalAdd | Adds value in decimal format to current value in decimal format
|
DecimalAnd | Make binary AND. Mask is in decimal format.
|
DecValue2Hex | Inversion function to Hex2DecValue. Converts each pair of decimal number to hexadecimal digit. (08 -> 8, 11 -> B). Input must have even length. Example:
|
Hex2ASCII | This is inverse function to ASCII2Hex. Converts hexadecimal string into ASCII representation. Input string could have maximum length of 16 signs. Otherwise original input is returned.
|
DESDecrypt | Decodes value encrypted by DES in Base64 format. Example:
|
DESEncrypt | Encodes value into DES and Base64 format. Example:
|
Hex2ASCII | Converts hex number to its ASCII representation. It is inversion function to ASCII2Hex; Example:
|
Hex2Dec | Converts number from hexadecimal format into decimal format.
|
Hex2DecValue | Converts each hexadecimal digit into decimal representation (8 – 08, A – 10, B – 11, etc).
|
Hex2Oct | Converts number from hexadecimal format into octal format.
|
HexAnd | Make binary AND. Mask is in hexadecimal format. Similar functionality contains DecimalAnd.
|
IsEmbed | Allow next processing only if card number is from embedded reader.
|
IsEven | Allow next processing only if card number length is even.
|
IsLength | Allow next processing only if card number length is equal to specified value.
|
IsLengthGreater | Allow next processing only if card number length is greater than specified value.
|
IsLengthNot | Allow next processing only if card number length is different from value.
|
IsNotStartWith | Allow next processing only if card number doesn't start with specified string.
|
IsStartWith | Allow next processing only if card number starts with specified string. Syntax:
Example:
|
LeftAppend | Append specified string from left side. Similar functionality has RightAppend.
|
LeftCut | Cut specified prefix from left. If prefix doesn't match than do nothing.
|
LeftHexShift | Unary bit operation LEFT SHIFT for specified count of bits. Input and output are in hexadecimal format. This operation is equivalent to multiplying by 2count
|
LeftPadding | Pads with specified sign from left to specified length.
|
LeftShift | Unary bit operation LEFT SHIFT for specified count of bits. Input and output are in decimal format. Similar behavior has LeftHexShift. This operation is equivalent to multiplying by 2count
|
LeftStrip | Strips specified sign from left.
|
LowerCase | Convert alphabetical sign to its lowercase representation.
|
LRC | Computes Longitudinal Redundancy Check http://en.wikipedia.org/wiki/Longitudinal_redundancy_check and adds it to the end. Example:
|
MD5 | Computes MD5 hash of input. Example:
|
Replace | Replaces all occurrences of one sequence with another one.
|
Reverse2 | Byte reverse - it is useful only for hexadecimal input because 2 signs represent one byte. Therefore this operation makes reverse string by pair. Even length is necessary.
|
Reverse | Reverse of string.
|
RightAppend | This function is similar to LeftAppend. Append specified string from right side.
|
RightHexShift | Unary bit operation RIGHT SHIFT for specified count of bits. Input and output are in hexadecimal format. This operation is equivalent to dividing by 2count
|
RightPadding | Pads with specified sign from right to specified length.
|
RightShift | Unary bit operation RIGHT SHIFT for specified count of bits. Input and output are in decimal format. Similar behavior has RightHexShift. This operation is equivalent to dividing by 2count
|
RightStrip | Strips specified sign from right.
|
SignReverse | This conversion takes every string in hexadecimal format and makes its binary reverse. For example (5 is represented in binary as 0101, reverse transfer it into 1010 that is A)
|
Substring | Selects substring of input. If any argument is negative then it is used from right side (from end).
|
Swap12785634 | Swap 4th byte with 2nd. It is useful only for hexadecimal format.
|
SwapPair | Swaps even and odd signs.
|
UpperCase | Convert alphabetical sign to its uppercase representation.
|
Example of use
Importing PIN codes from a directory service - to be able to import PIN codes from a directory service such as Active Directory it possible to use a conversion while importing a plain text number (e.g. 1234). However, SafeQ by default expects to verify the PIN number in a hash format. Therefore the solution would be to configure "PIN code conversion" and use the following conversion:
MD5;LeftAppend(PIN)