One of the reasons I cryptographically scramble identifiers in public URLs is because business growth is not always public.
If the current identifiers can be displayed simply by creating a new user account or uploading an image, then the external user can calculate the growth rate (or upper limit) by doing this on a regular basis and seeing how many identifiers have been used over the past time.
Regardless of whether it is stagnant or it explodes exponentially, I want to be able to control the release of this information, and not allow competitors or business analysts to bring it out for themselves.
Stand-alone examples of this are account numbers and checks. If you regularly pay or pay a company, then you can see how many bills or checks they write in this period of time.
Here's the CPAN (Perl) module, I support that scrambles 32-bit identifiers using SkipJack-based two-way encryption:
http://metacpan.org/pod/Crypt::Skip32
This is a direct translation of the Skip32 algorithm, written in C by Greg Rose:
http://www.qualcomm.com.au/PublicationsDocs/skip32.c
Using this approach maps each 32-bit identifier to a (effectively random) corresponding 32-bit number, which can be canceled back to the original identifier. You do not need to save anything in your database.
I will convert the scrambled identifier to 8 hexadecimal digits for display in urls.
Once your IDs reach 4.29 billion (32 bits), you will need to plan on expanding the URL structure to support more, but I like to have shorter URLs for as long as possible.
source share