Comments (3)
It is not a problem if the lengths are different: we aren't assuming that the length is hard to guess.
Even if you added fake comparisons, you'd still be able to guess the length, because you could just try increasing b.length
until it exceeds a.length
. This will add in fake comparisons, which will cause a noticeable increase in time, and so you will then know a.length
.
See, for example, https://golang.org/src/crypto/subtle/constant_time.go
Also, there's a decent chance that the compiler would just optimize out the a[i] ^ a[i]
operation, and remove the fake comparisons altogether. Any time we do constant time comparison, we have to be careful about how smart the compiler is. :)
from java-aes-crypto.
true, thanks for the response
from java-aes-crypto.
Thanks for the suggestion — keep 'em coming. I definitely had the exact same thought the first time I saw it. :)
from java-aes-crypto.
Related Issues (20)
- Allow some params to be editable HOT 2
- Performance issues with PBKDF2WithHmacSHA1 HOT 7
- Any way to encrypt and decrypt on different devices? HOT 8
- Question about license and using strong encryption outside of USA HOT 2
- Support for GCM chiper transformation HOT 5
- aes-crypto missing from Maven Central HOT 4
- request: java jre/jdk specific version HOT 5
- Where should I store the salt? HOT 1
- Encrypted Stream... HOT 2
- Caller-provided IV not permitted HOT 2
- android decode was not quickly
- Simple native java code to decipher this encryption HOT 1
- Add feature to store keys in Java Keystore (JKS) / Android Keystore (AKS) HOT 14
- SecureRandom.getInstance("SHA1PRNG") is deprecated HOT 2
- Build.SERIAL is deprecated in SDK 26 and will return UNKNOWN HOT 4
- Users be warned. SHA 256 instead of PBKDF2 HOT 2
- Security alert on our production app on google play console HOT 6
- Decryption returning something weird. HOT 3
- AES CRYPTOID
- 更新 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-aes-crypto.