confidentiality - Timing Safe String Comparison - Avoiding Length Leak (opens in new tab)馃捑Prompt Caching

If you want to not leak length, compare a pre-hashed value. Attacker can know how long to hash their input but (and use a timing-safe comparision for the hashes; somewhere else has a hash + random salt method that doesn鈥檛 require a timing safe equals since the target value is randomly permutated) can鈥檛 know how even how long the target string is.

Keyboard Shortcuts

Navigation

Next / previous item
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help