From d742a049a289ee50e94affc8cc350ebdcadf983e Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Sun, 10 Sep 2023 23:39:41 +0700 Subject: [PATCH] crypto (1/?) --- posts/2023-08-23-real-world-crypto.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/posts/2023-08-23-real-world-crypto.md b/posts/2023-08-23-real-world-crypto.md index 58378d1..8e5bda0 100644 --- a/posts/2023-08-23-real-world-crypto.md +++ b/posts/2023-08-23-real-world-crypto.md @@ -16,3 +16,16 @@ authentication tag. **HMAC** is MAC using hash. - A send B message with MAC (generate from message and A key). - B double check message with MAC (generate from receive message and B key). - A and B use same key. + +```mermald +sequenceDiagram + participant alice + participant bob + + alice ->> bob: send username, password + bob -->> alice: return alice|mac(private_key, alice) + alice ->> bob: send alice|mac(private_key, alice) + bob -->> alice: return OK + alice ->> bob: send bob|mac(private_key, alice) + bob -->> alice: return ERROR +```