Sergey Tsibel
Sergey Tsibel

Reputation: 1625

Laravel Encryption string length

When I apply Crypt::encrypt(1) I'm getting this encrypted string:

eyJpdiI6IlBoQnliQkZkb0NPT1g5NG9FbkpqV2hLa3ZLUnlWSEFRMEZwM2YxTEdNVk09IiwidmFsdWUiOiJ0N0kyWmZvRWVETzE3WTJWVU5DS1ZpTVFYTGpXNHQxT2YyQWdsMFgxK0xvPSIsIm1hYyI6IjAzMjAzNzdhNzZmYmZiZDVkZGJkMjM5MWY5NjhkNzJjMWFhMzNiYmYyZDJkODNlMmFkODcyNzdhYTE3ZjFkODMifQ==

Is it possible to make string shorter (4-5 times shorter) in Laravel, using the same two-way encryption?

Upvotes: 1

Views: 7323

Answers (1)

Sergey Tsibel
Sergey Tsibel

Reputation: 1625

What you want to do, instead of encrypting uri portion is obfuscate it. For example, one of the great libraries for php is Hashids

Upvotes: 4

Related Questions