On my website I display an image. To generate this image, it require a string parameters. For example the string 1234,2423,1231
as the parameter.
Anyone can use my API (no authentication required). For example example.com/generate?param=1234,2423,1231
. That is how my API works right now. To generate a different image, all you have to do is provide different numbers and different amount of numbers, like 2342,2423,234
.
However, I do not want people to be able to keep generating images by themselves by simply changing the numbers. So if I encrpyt the parameter and then let the user load the image, they would never know how to generate an image themselves. So an example of an encrypted API request would be example.com/generate?param=s97dgfubYVd80fzhgdfufg0894rf
which would correspond to example.com/generate?param=1234,2423,1231
.
The add on to this problem is, I tell the user "we are going to generate an image with the parameters 1234,2423,1231
. Here is the API link to generate this image: example.com/generate?param=s97dgfubYVd80fzhgdfufg0894rf
".
So what encryption method can I use.