Can I create a fixed length output from a fixed length input? I use AES256 for various purposes in my app. However, the purpose I am now trying to achieve is the following: 

Input is for example AU00000001 and I would like a hashed or encrypted output of this with the same length (10 characters). I need to keep the output as small as possible, to convert it into a simple (minimal dots) QR code. And I do need the ability to reverse that output back to the original input.

I've read a few posts around here but I can’t find what I am looking for. Can you give me a hint or maybe point me to some references?
See “format-preserving encryption” at WikiPedia.

Depending on the size of the message space, one can get such a scheme by:


sorting pseudorandom values, see section 4.1 of “Format preserving encryption”,
or
using this arbitrary-size scheme described in “Perfect Block Ciphers With Small Blocks”,
or
using swap-or-not as described in “An Enciphering Scheme Based on a Card Shuffle”.


Nota bene: we also have a format-preserving tag that points to related questions and answers.