RBC Encryption
To facilitate standardised RedBook Code encryption for sharing between licensed RedBook customers, RedBook provides API encryption and decryption endpoints. These endpoints utilise a hidden key, held by RedBook and not published, identified by a source date. A new key is available 1 month in advance.
Every customer should utilise this month's key, with keys named YYYY-MM. For example, the key
for January 2000 is 2000-01. The source_date query parameter on either operation is optional
and takes a source date in this form; omit it to use the current month's key.
Availability: available for car, heavy, bike, the caravan segments and the marine segments (AU); not available for any other segment. See Availability by segment.
Operations
| Operation | URL |
|---|---|
| Encrypt RBC | GET /v1/{country}/{segment}/rbc/encrypt/{rbc} |
| Decrypt RBC | GET /v1/{country}/{segment}/rbc/decrypt/{rbcEncrypted} |
A 15-character RedBook Code will become a 32-character encrypted RedBook Code. By convention,
when a RedBook Code is encrypted it is encased within ([ and ]), the form Encrypt RBC returns
as EncryptedRBC. When transmitting an encrypted RedBook Code, also transmit the source date of
the key, so your recipient can select the correct key: the sender calls Encrypt RBC, and the
recipient calls Decrypt RBC, supplying that source date as source_date and receiving the
original RedBook Code back as DecryptedRBC.
For example:
| RedBook Code (un-encrypted) | Encrypted RedBook Code | Source Date |
|---|---|---|
AUVBMW_2022AEBR |
([A5932163050FFA13963795DA42E6809B]) |
2000-01 |
Decrypt RBC accepts the encrypted RedBook Code either encased in ([ and ]) or as the bare
32-character hexadecimal value. Sent in the request path, the enclosing characters are
percent-encoded: %28%5B before the hexadecimal value and %5D%29 after it.
An incorrect source date is not guaranteed to fail: a key appears to stay valid for about a month
either side of the month it names, so a source date one month off may still decrypt successfully.
source_date should not be relied on to validate when a code was encrypted. A source date
further off falls outside RedBook's retained keys and returns an error instead of a result.
For customers that are using RedBook flat-file, the API encryption system is interoperable with the process as defined for flat-file. You may however wish to switch across to using the API to manage encryption, as we have implemented the algorithms for you. To enable this functionality, please contact RedBook Support.