To begin with I need to say I have no experience in cryptography (I'm a software developer) and found this place trying to figure out how to solve this, Here is the problem I need to solve in my job:
- Input: an integer varying from 1 up to 8 digits (i.e. 12345678, 2352, 76543)
- Output: a fixed size 6 digits code that could contain any alphanumeric and symbols (a-z, A-Z, 0-9, !@#$%*()|-_=+^/?)
- The operation must be reversible, so given a code it should decode back to the original integer
- There's no need for the output code to be cryptographicaly safe
From my research I think I need some encryption algorithm to achieve this, but I couldn't find one that allow me to set the output size. Is it possible to be done?
I need to implement this code in NodeJS so any lib that could handle this job is appreciated