I am trying to create and encryptor and parser for my personal project.
Suppose I encrypt latin alphabet as follows:
a = a;
b = ab;
c = aab;
....
z = a...ab
In this case the string "aaab" can be decrypted in multiple ways:
ac, aab
But if I encrypt the alhabet as follows:
a = a;
b = ab;
c = abb;
....
z = a...bb
In this case any string can be decrypted in one and only unique way.
Is there an algorithm or theorem that describes this behavior? Will this be a correct encryption or for a very long strings I can somehow gain ambiguity.