572 karma · joined Sep 18, 2010 (16y ago) · 143 submissions
comment 5y ago · link · parent
1/ Google Search, YouTube, Maps: visit https://myactivity.google.com/activitycontrols to turn on auto-deletion or turn off search history, location history or YouTube watch history. This page also allows you to turn off ads personalization. There are many security and privacy controls on https://myaccount.google.com/, turn them on however you see fit.
2/ Chrome: visit chrome://settings/syncSetup to turn off Chromesync, disallow Chrome sign-in, disable automcomplete searches and URLs, etc. You can also change the default search engine to something else, but see point 1/ if you want to use Google Search. Use Incognito mode more often.
3/ Gmail, Photos, Calendar, Drive, Docs: "we don’t use information in apps where you primarily store personal content—such as Gmail, Drive, Calendar and Photos—for advertising purposes, period." [1] In other words, Gmail, YouTube or Search ads are not targeted or personalized using your emails, photos, events, docs, etc.
Disclosure: I'm a Google's security engineer, advocating for and contributing to some of the aforementioned security/privacy controls.
[1] https://blog.google/technology/safety-security/keeping-priva...
32.
Advisory: Security Issues in AWS KMS and AWS Encryption SDKs(vnhacker.blogspot.com ↗)
3 points · by cryptbe · 6y ago · discuss
33.
You want to encrypt password hashes(vnhacker.blogspot.com ↗)
11 points · by cryptbe · 6y ago · discuss
34.
A history of elliptic curves in tweets(vnhacker.blogspot.com ↗)
11 points · by cryptbe · 6y ago · discuss
comment 6y ago · link · parent
Well said.
If you are to implement a sorting algorithm, you'll know immediately whether it works or is fast enough. Crypto doesn't provide this feedback. It's important to get help from others, if you can't tell yourself whether your code works.
comment 6y ago · link · parent
>Those rules aren't easy to follow, but they are simple to know about.
If the rules were so simple, how come your library had a signature bypass vulnerability that you did NOT understand its root cause until I explained?
The root cause looks deceptively simple, until you take your time to understand the underlying math. I didn't fully understand it until a professor at MIT explained it to me. Maybe it's just that I'm stupid, but it is never simple to me.
>About not using your crypto until it's been vetted by professionals… How do you get those vaunted professionals to even look at your work?
You can't expect people to pay attention to your work until you earn it. Why would anyone bother reviewing a random library from a random dude? Frank of libsodium fame didn't start by writing a brand new library from scratch, but built it on top of NaCl. If he did that, nobody would take him seriously either.
>About CTF (Capture The Flag), and cryptopal challenges, my advice is: don't waste your time. The penetration testing approach to secure systems does not work. You whack a mole, two more appear. We need ways to prevent whole classes of errors, like proofs. For instance, tools like https://verifpal.com/ can be a great help when designing a protocol.
This was how my friends and I got started. Maybe you were right that it isn't worth it, but it helps get us to where we are, being paid to do security and crypto.
There are two approaches to learning: top down or bottom up.
The former is what you get at university. If you want to learn crypto, you have to learn abstract algebra, linear algebra, probability theory, complexity theory, and computer security. If you want to learn complexity theory, you want to learn automata theory, computability theory, and algorithms. If you want to learn computer security, you want to learn computer architecture, operating systems, networking, etc.
The top down approach is systematic, but it might not prepare you for the real world. For that, you need internships and CTFs. They are reality checks with a fast feedback loop, showing you very quickly which skill or knowledge you are lacking or need improvement. They are also fun.
comment 6y ago · link · parent
>I hope this doesn't come off as entitled, but I feel like the best way to get people to stop rolling their own crypto is to provide more/better libraries.
Author here. I mentioned libsodium [1] and Tink [2]. We started Tink because we want to provide more/better libraries.
>Granted, this is getting better, for example NaCl's crypto_box[0] is awesome and very hard to misuse. But say you want forward secrecy now. chirp, tumbleweed.
It looks like you want to build an interactive protocol. I'm not sure if libsodium has a solution, but Tink doesn't. So far we've been focusing on encryption at rest. Can you tell me more about your use case?
comment 6y ago · link · parent
Symmetric encryption algorithms usually need an input called the initialization vector (IV), but different algorithms have different requirements.
AES-CBC requires unpredictability, but AES-CTR (and AES-GCM) require uniqueness. Misunderstanding of these requirements have led to real world attacks, see for example BEAST or https://eprint.iacr.org/2016/475.pdf.
comment 6y ago · link · parent
The exploit is very efficient and fits in a tweet:
1. Take C = E(K, IV) \xor P from GCM encryption
2. Make a guess of P, send (IV \ xor PADDING) || (C \xor P_guess) to the CBC oracle where PADDING is a fixed constant. If the oracle returns that the padding is correct, P_guess is correct. Otherwise make another guess.
The root cause of the issue runs pretty deep. It's a class of crypto vulnerabilities we called "in-band protocol negotiation". That is, the ciphertext contains protocol-related parameters that determine how it should be decrypted. The JWT standard has this issue, which has led to countless "alg": "none" vulnerabilities. JWT is not alone, this mistake is presented in many other libraries or standards.
I wrote about how we avoid this issue in Tink [2] [3]:
>2/ A key in Tink contains not only the raw key material, but also all necessary parameters. It is equivalent to the result of a handshake. Before any data encryption can take place, both sides have to reach an agreement not only on a raw key, but also how to use that key to encrypt data. Since a key in Tink contains all parameters, Tink does not require in-band ciphersuite negotiation. That is no ciphertext in Tink contains any other metadata aside from a key ID.
>This design sounds so simple but I've seen people get this wrong all the time. For example, the root cause of many embarrassing vulnerabilities in JWT [1] is in-band ciphersuite negotiation. That is, a JWT contains an alg field that dictates how the receiver should process it. This alg field should rather be included as part of the key.
>JWT is not the only standard making this mistake. Many crypto libraries only ask users for the raw key material. This means the parameters are either implicitly assumed or under specified. Aside from the aforementioned vulnerabilities, this can also lead to key confusion, cross-protocol key reuse and make it hard to rotate keys or change algorithms.
>To the best of my knowledge, Tink is the only high-level library that gets this right.
[1] https://github.com/google/security-research/security/advisor...
43.
Crypto Vulnerabilities in AWS S3 SDK(twitter.com ↗)
7 points · by cryptbe · 6y ago · 1 comment
comment 6y ago · link · parent
We have a test package for Linux with Python 3.7 or 3.8
pip3 install -i https://test.pypi.org/simple/ tink
comment 6y ago · link · parent
From a user's point of view, keys are still binary blob. Internally Tink serializes keys using protobuf, but in principle it supports arbitrary key formats via the KeysetReader/KeysetWriter interfaces. Admittedly, this aspect of our design is somewhat clumsy. We're working on a new design.
The key differences (pun intended) between Tink and other libraries are:
1/ Tink works with keysets instead of individual keys. This enables key rotation and crypto agility. This is very important at Google because there are systems that generate too much data to encrypt with a single key. We want to be able to rotate keys and still be able to decrypt old ciphertext.
Also most crypto schemes we're using today would be broken eventually. We want to make sure we can add new schemes and retire old ones over time without users having to change their code. For example, a lot of libraries have functions containing algorithm names, e.g., aes_gcm_encrypt. When GCM is no longer adequate, users of these libraries would have a hard time upgrading to alternatives.
Tink interfaces don't contain the algorithm name. We name our APIs after generic crypto primitives rather than famous cryptographers or algorithms. For example, we provide a generic AEAD interface for symmetric key encryption. With proper key management, users don't have to know anything about any particular algorithms and can easily rotate to new ones without changing a single line of code (rather than upgrading Tink).
2/ A key in Tink contains not only the raw key material, but also all necessary parameters. It is equivalent to the result of a handshake. Before any data encryption can take place, both sides have to reach an agreement not only on a raw key, but also how to use that key to encrypt data. Since a key in Tink contains all parameters, Tink does not require in-band ciphersuite negotiation. That is no ciphertext in Tink contains any other metadata aside from a key ID.
This design sounds so simple but I've seen people get this wrong all the time. For example, the root cause of many embarrassing vulnerabilities in JWT [1] is in-band ciphersuite negotiation. That is, a JWT contains an alg field that dictates how the receiver should process it. This alg field should rather be included as part of the key.
JWT is not the only standard making this mistake. Many crypto libraries only ask users for the raw key material. This means the parameters are either implicitly assumed or under specified. Aside from the aforementioned vulnerabilities, this can also lead to key confusion, cross-protocol key reuse and make it hard to rotate keys or change algorithms.
To the best of my knowledge, Tink is the only high-level library that gets this right.
[1] https://auth0.com/blog/critical-vulnerabilities-in-json-web-...
comment 6y ago · link · parent
I'm not sure if NaCl itself is production ready, but I'm a great fan of libsodium. If I weren't working on Tink, I'd use libsodium for my personal projects. Did you know that Frank Denis [1] the creator of libsodium is not working full time on crypto or security? He's a professional photographer. I can't figure out how he manages to single-handedly maintain such a high-profile high-quality library as a side project. We have a team of full time cryptographers and engineers working on Tink, but we've struggled a lot.
We started Tink because all existing libraries that we had at Google didn't meet our requirements.
Business-wise, we need an open source library that can work on all major platforms that Google products run on including web, iOS, Android, Borg and GCP. There are many Google products that need crypto integration with external partners. While we can take care of the crypto implementation on our side, we found that many partners got it wrong. It'd be very nice if they can use the same library that we're using internally.
We learned very early that a single ciphersuite wouldn't work for everybody. Some would need short ciphertext. Some would need speed. Some would need FIPS certified. We want a library that can support a wide range of options. It should be easy to add new options and remove old ones.
Security-wise, we found that most libraries are either too high-level or too low.
The latter ask users for security-critical input such as nonces or randomness. In most crypto schemes, using a wrong kind of nonces can totally break an otherwise secure scheme. Based on our experience working with tens of thousands of engineers at Google, we found that most engineers can't tell why the IV must be non-repeated in some schemes but unpredictable in others. More importantly, we found that this level of control is not needed when using crypto to implement security/privacy features in most of our products. Tink aims to eliminate as many potential misuses as possible. For example, if the underlying encryption mode requires nonces and is insecure if nonces are reused, then Tink does not allow the passing of nonces by the user.
Why is too high-level also a bad idea? We found that many libraries provide a single API for different kinds of crypto primitive. For example, sign() is used for both MAC and digital signatures, and encrypt() for both AEAD and public key encryption. This reduces readability, making code review much harder because the crypto APIs can't provide accurate information on the security guarantees of the implementations.
Last but not least, Tink encourages the usage of key management system. Most libraries don't care where the keys come from, and as a result many users use hardcoded keys. Tink encourages developers to store keys encrypted or within a KMS. It provides security teams mechanisms to enforce this requirement. For example, at Google developers can't use Tink in production with keys stored outside our KMS, unless they got an explicit approval from us.
Further explanations of these design goals can be found in [2].
To wrap this up, IMHO libsodium and Tink are targeting different groups of audience. libsodium is great for personal projects, when you know what you're doing and can take care of yourself. Tink provides more bells and whistles which are useful when you want to do crypto in an enterprise setting.
[1] https://00f.net/
[2] https://github.com/google/tink/blob/master/docs/SECURITY-USA...
comment 6y ago · link · parent
We've added tons of new features since 2018, including support for two new languages Golang and Python.
The team has grown from 4 20% contributors to 5 full-time and countless contributors.
Please checkout the following release notes for a list of changes:
comment 6y ago · link · parent
comment 6y ago · link · parent
They tried hard to discrete me. My initial report had an error, that is I didn't know that Bluetooth on Android needs ACCESS_FINE_LOCATION permission. A person pointed this out in a comment -- he posted and rewrote it three times. I said thank you and thought that's that, but then he and a bunch of new people commented that since I made that basic mistake I'm immature and inexperienced, therefore the rest of my findings have no merit.
Someone then posted a super long comment, raising a lot of questions about my credibility and intention. The interesting thing is they claimed that they're a student, haven't installed the app, have no intention to do so, but care a lot about privacy. Essentially they want to show that they're merely an underdog bystander standing up against my wrongdoings. I thought this is a very subtle psychological trick, aiming to amplify their attacks.
Other attacks are more direct. For example, a person pointed out that since I don't have many followers on Twitter, I'm not a good engineer. They said I didn't really contribute anything to my public research, but I just took credit from my coauthors. That I am only cleaning toilet at Google, there's nothing proud about that.
After I posted a rebuttal to the developers' rebuttal, a guy [2] dropped this one-line comment:
>cái vụ này bắt đầu thấy nhảm rồi. Lập luận của anh Thái cũng không còn chặt chẽ như trước nữa.
Which translates to "This is getting nonsense. Thai's argument is not as strict as before".
The title of the guy's blog [3] is, I kid you not, "There's always only one truth: Communist Party of Vietnam.
[1] https://en.wikipedia.org/wiki/Public_opinion_brigades
comment 6y ago · link · parent
I have no strong evidence, but it seems that Force 47 is actively monitoring my blog [1]. I've never got so many personal attacks and smear comments like I did since I published my findings. I bet one of them will cite your comment as an evidence of my "immaturity".
53.
Vietnam's contact tracing app broadcasting a fixed ID(vnhacker.blogspot.com ↗)
107 points · by cryptbe · 6y ago · 33 comments
comment 6y ago · link · parent
comment 6y ago · link · parent
When I started learning crypto, I spent a lot of time reading A Computational Introduction to Number Theory and Algebra [1] another free, high-quality book by Shoup. I did a lot of exercises, even corrected some results in the book, and at one point thought that I wanted to publish a solution manual. I emailed professor Shoup, but he said it may not be a good idea because people would copy my solutions for their homework. It turns out he's right. The blog posts that I published still get hit from time to time, and the search keyword is always solutions for NTB [2] =).
Later on, I took CS255 [3] from Boneh. I had to pay for it myself. IIRC it was $4,000 or something. It was a huge amount of money where I'm from. I took an overdraft from my bank to pay for it, the best money I ever spent! I still remember in one of the classes when Boneh was talking about the Diffie-Hellman protocol he paused to ask us, "Do you know where this was invented?" Nobody knows, then he pointed to his left and said, "In a room a few yards from here". I felt like I was part of this amazing history. There's a stream of knowledge flowing through me and maybe one day I'd discover something cool.
Boneh is simply the best teacher. He knows everything. I like it when he poses an open problem, and ends with "if you can solve this, I'll be a friend forever". He doesn't just love teaching, but also knows how to inspire and apparently can't stop explaining things.
[1] https://www.shoup.net/ntb/
[2] https://www.google.com/search?rlz=1C5CHFA_enUS851US851&ei=z0...
comment 6y ago · link · parent
This "SIV" mode is silly and breaks down completely when encrypting more than 2^32 IDs.
Your proposal is not only faster, but also safer. AES is a strong pseudorandom permutation, the 00000000 padding is a perfectly fine integrity check.
comment 6y ago · link · parent
I'm not sure why TweetNaCl is even considered a serious crypto library. I guess that it can fit in tweets, but this is an optimization that is at best irrelevant at worst a bad software engineering practice.
Re malleability: instead of just thinking about this issue in an abstract way, I recommend writing an exploit. For example, Tink doesn't check R or A at all, try to see if you can produce a new signature from an existing one by modifying R or A as you said.