this post was submitted on 22 Aug 2023
6 points (87.5% liked)

Web Development

3431 readers
1 users here now

Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development

What is web development?

Web development is the process of creating websites or web applications

Rules/Guidelines

Related Communities

Wormhole

Some webdev blogsNot sure what to post in here? Want some web development related things to read?

Heres a couple blogs that have web development related content

CreditsIcon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 1 year ago
MODERATORS
 

cross-posted from: https://lemy.lol/post/4569543

I need to

  • encrypt JSON payload (not just sign)
  • not share private key
  • verify the payload is generated with the shared public key and RSA fitting all of these.

As I've only made auth with JWT so far, I'm not sure. If I use RSA, I guess I have to put the encrypted text in the body.

Do you think it can be used? Any other suggestions?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 1 year ago

mTLS would be sufficient and honestly more than enough, it sounds like. Plain TLS (client validates the server) will encrypt all traffic in transit end to end, using appropriate handshakes and symmetric cyphers. Anything using RSA directly will be significantly more likely to be incorrectly implemented and thus worthless.

mTLS would allow you to trust a CA per user, a cert per user, or issue your own keypairs for clients, depending on the use case. You validate the connection and look up the client based on some certificate field like CommonName or any of the other fields.

Then you've authenticated, and you can perform authorization for any transactions on that entire connection, plus you know for certain if it was MITMed it was done by someone with access to keys trusted by both parties.