I'm looking for a way to encrypt a fixed length numeric ID into a fixed length string.

Asked 2 years ago, Updated 2 years ago, 53 views

In order to make it difficult for users to guess other users' IDs, I would like to convert the ID of the numbers used inside the system into a fixed length string and send it to the screen side. Is there an appropriate encryption method?

Image
00001 ←→ AAAAB
00002 ←→ AAAAC
00003 ←→ AAAAD
00004 ←→ AAAAE
これ This is too simple, but I would like to encrypt and combine cost first.

cryptographic-theory

2022-09-30 17:41

1 Answers

Generating and saving a UUID for an identity column would be a common answer for users.

By the way, if you have to uniquely encrypt and share the ID with the user, I think it will be like that for now if you send a hexdump of the encryption result to the user using common key encryption per AES256.(If the range of IDs is 128 bits or less, the encryption result will be a 32-character [0-9a-f] string.)


2022-09-30 17:41

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.