Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a token and a digest?

I'm learning about authenticating users in rails and the concept of tokens and digests keep reappearing. I think I understand the general idea of what their purposes are in general, but I don't understand the difference between the two.

like image 627
Harry B. Avatar asked Nov 24 '25 18:11

Harry B.


1 Answers

  • Token is just a random string
  • Digest is a hashed string

A cryptographic hash function is a procedure that takes data and return a fixed bit string: the hash value, also known as digest. Hash functions are also called one-way functions, it is easy to compute a digest from a message, but it is infeasible to generate a message from a digest.

Read more about digest here: http://apidock.com/ruby/Digest

like image 95
Tan Nguyen Avatar answered Nov 27 '25 11:11

Tan Nguyen