Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
Is it faster to read a signature or to decrypt a string when using tokens for authentication?

I'm new to everything related to authentication and have no knowledge about encryption algorithms. I was reading about JWT, but from what I gathered, it'd make more sense for my project to authenticate users using either one of these 2 strategies:

  1. Sign with the server's private key a publicly readable JSON, such as:
const token = {
  "user": "johndoe",
  "iat": 4342342352,
  "exp": 4352234322
}
  1. Or encrypt that JSON content and only allow the server to decrypt it
E.g.: 
// server sets token
encryptionLibrary.encrypt(token, "AES-256", "server's super password")
// then decrypts it when the token is sent with a HTTP request
encryptionLibrary.decrypt(token, "AES-256", "server's super password")

Question: Would checking the signature only be faster than decrypting the whole string or is it absolutely dependable on the implementation? (i.e., using a fast/slow library).

Related question: if I already know the content of an encrypted string (let's say I know it's the token variable above) and the encryption algorithm, will this make it possible to break my password? (thus, rendering option #2 unsafe)


Why not simply use JWT instead? Looks like too much bloat for my project, I just need a way of storing on the client's end a JSON with user, iat and exp information and letting the server prove it's legit. Signing or encrypting the whole payload should stop attackers from creating false tokens, I think

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!