Better HN
topnewbestaskshowjobs
Log inSign up

CiPHPerCoder

6,663 karma · joined Feb 25, 2016 (10y ago) · 1,775 submissions

My name is Scott. I do a lot of open source security research, and cryptography.

Previously AWS Cryptography (2019 - 2023).

Unless otherwise stated, my opinions are my own and do not reflect my employer.

https://scottarc.blog/about/

Submissions

1351.

Untangling the Forget-Me Knot: Secure Account Recovery Made Simple(paragonie.com ↗)

1 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

Just use uBlock Origin. These details don't really matter to most people.

1353.

image/svg+xml considered harmful(gist.github.com ↗)

2 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

People confuse Free Software to mean gratis rather than libre. It can be, but it doesn't have to be.

1355.

On the Design and Implementation of a Stealth Backdoor for Web Applications(paragonie.com ↗)

2 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

> Hm, why userspace PRNGs are bad? Does code executed in kernel mode become better automatically?

At the beginning of the blog post there are three links.

  adequately -> http://www.2uo.de/myths-about-urandom/
  covered    -> http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/
  elsewhere  -> https://blog.cr.yp.to/20140205-entropy.html
I highly recommend reading all three. They answer your question in painstaking detail.

> Also, do you think Java's SecureRandom is not a user space implementation? I guess it only uses /dev/[u]random for seed.

In Java 8, it just reads from urandom. The relevant section has a cautionary note: https://paragonie.com/blog/2016/05/how-generate-secure-rando...

comment 10y ago · link · parent

You totally can, but more importantly, you shouldn't. :)

comment 10y ago · link · parent

We can't condone any solution that depends on userspace PRNGs like OpenSSL instead of the kernel's CSPRNG.

There are probably worse examples of userspace PRNGs that attempt to be cryptographically secure than what OpenSSL provides, but we wrote this to encourage good habits. Reliance on OpenSSL's PRNG is definitely not a good habit to get into.

The "General Requirements for Inclusion" section is our basic evaluation criteria. Cross-platform APIs that wrap the operating system's CSPRNG aren't that difficult. See https://github.com/cryptosphere/sysrandom/blob/master/ext/sy...

comment 10y ago · link · parent

Oops! How did I miss that? Thanks for letting me know.

Fixed, and a bunch of suggested additions are coming later today. :)

comment 10y ago · link · parent

In balance, Linux 4.8 will bring some much-needed improvements to Linux's urandom implementation.

But they still maintain a "meaningful" distinction between random and urandom, which is the most frustrating design smell.

comment 10y ago · link · parent

> urandom by definition doesn't block.

That's precisely why getrandom(2) is preferred on newer kernels, and the following hacky workaround from the article is given on older kernels:

  For software that runs during the Linux boot, poll /dev/random until it's available.
  This means /dev/urandom has been seeded and you can safely read from /dev/urandom for
  all your cryptographic purposes. Don't read from /dev/random.

comment 10y ago · link · parent

As of WordPress 4.4.0, wp_rand() is fine.

https://paragonie.com/blog/2015/10/coming-wordpress-4-4-cspr...

I had already suggested (to Dion Hulse) that this antipattern of pinging wordpress.org to define the salts during setup be removed in favor of always generating them locally.

I don't know if/when they'll implement that (no matter what benefits a security fix might provide, WordPress always prioritizes "no BC breaks even on 0.0001% of the installed base" first), but if you're looking for a more secure CMS I happen to be building one here:

https://github.com/paragonie/airship

comment 10y ago · link · parent

I do, actually, but I haven't accessed it in almost two years. EDIT: And I forgot my password. Here's a new one:

  1D6RMsgnTAf2GLWpD91EaQvQ5ppuaZKkGT

1364.

How to Generate Secure Random Numbers in Various Programming Languages(paragonie.com ↗)

245 points · by CiPHPerCoder · 10y ago · 113 comments

comment 10y ago · link · parent

Yes: Aside from being a userspace CSPRNG (which is an additional risk of failure over the kernel's CSPRNG and doesn't provide defense-in-depth), it isn't thread-safe.

https://github.com/ramsey/uuid/issues/80

https://github.com/nodejs/node/issues/5798

There are also some recent IACR papers (linked in the Node thread), but those are the two biggest concerns.

comment 10y ago · link · parent

> If you need a PCI Auditor, make sure they have a background like me

Maybe you're being flagged for the blatant self-promotion? I can't say for sure, as I wasn't the one who clicked 'flag'. You may want to tone it down a bit.

comment 10y ago · link · parent

If one of the project devs is reading this thread:

https://github.com/shadowproject/shadow/blob/f3fa333f8377688...

That's really hard to read.

Also, don't use OpenSSL: https://paragonie.com/blog/2016/05/how-generate-secure-rando...

comment 10y ago · link · parent

> The only whitepaper I could find for the whole system was for ShadowChat, which says they use AES-256-CBC to encrypt the chat.

Okay.

> AES is a symmetric encryption algorithm, and a strange choice for a chat protocol.

No, it's the standard choice.

Signal uses AES-256-CBC + HMAC-SHA-256, for example.

> Furthermore, CBC is not great at hiding patterns, and chat will often have a lot of patterns.

That's not true. CBC mode isn't great at hiding patterns with IV reuse. Solution: Don't reuse IVs.

The problem with CBC mode is that it's unauthenticated, and as a result is often susceptible to padding oracle attacks that allow messages to be decrypted byte-at-a-time.

https://paragonie.com/blog/2015/05/using-encryption-and-auth...

A better mode would be GCM, or maybe GCM-SIV, or scrap AES entirely in favor of ChaCha20-Poly1305.

comment 10y ago · link · parent

https://github.com/shadowproject/shadow/blob/4e6affe1457116a...

Ever heard of IND-CCA3?

comment 10y ago · link · parent

This is precisely why, despite being a software security consultant, I don't cold email folks. Even if they don't perceive it as a threat, it feels too much like one to even write such an email.

comment 10y ago · link · parent

...Why?

To be clear: I proposed, if even possible, that would actually be a good way to resolve this debate.

"Yes, you can keep your guns, they're just totally ineffective at harming people now".

I wasn't taking a stance for/against gun control, or more broadly for/against the US Constitution. Telling someone to "just move to [some other country]" is needlessly hostile; the message it sends is, "You aren't welcome here."

The author of this post proposed a straw man of a "crazy sounding idea" to illustrate "solving the wrong problem"; what I'm saying is that it would be the right problem to solve if it were even possible.

(As far as my actual politics go on this matter: I'd like to see mandatory gun safety taught in places where they aren't illegal to prevent accidental misuse. Friends of friends have lost their lives to mishandled firearms. That's all you'll get out of me on HN.)

comment 10y ago · link · parent

> Seems to me a bit like equipping everyone with armour to make shooting them more difficult. Solving the problem the wrong way?

I don't know, making humans immune to bullets would be an elegant solution to the gun control debate which doesn't involve disagreements over the second amendment, and would make everyone win.

comment 10y ago · link · parent

CMS Airship

Github: https://github.com/paragonie/airship

Docs: https://github.com/paragonie/airship-docs

Airship is a secure-by-default CMS that applies security fixes within one hour of their release by our team in the default configuration. Code delivery is secured by cryptographic signatures, a system similar to certificate transparency, and reproducible builds from open source components.

License: GPL

Language(s) Used:

  PHP (version 7 with strict types)
    Twig templates
  SQL (currently only PostgreSQL 9.5)
  JavaScript
    jQuery
  HTML5 / CSS3 (with no regard for legacy IE compatibility)
How to help: https://cspr.ng/blog/2016/09/contribute-airship-non-expert-s...

Some more technical details in case HN is interested:

https://paragonie.com/blog/2016/05/keyggdrasil-continuum-cry... | How the auto-updater works (warning: cryptography protocols ahead)

https://paragonie.com/blog/2016/06/php-security-platinum-sta... | The version 1.0.0 blog post

https://paragonie.com/blog/2016/08/on-insecurity-popular-ope... | A comparison of the security of three most popular CMS platforms

comment 10y ago · link · parent

Where's the source code?

comment 10y ago · link · parent

This was written in PHP and intended for PHP projects, but porting it to another language shouldn't be too challenging. (If you like it and want something ported to your favorite language, let me know.)

CSP-Builder allows several use cases:

1. Generating a static CSP header from a static JSON file to store in the webserver configuration (saving developers from having to learn the syntax of the header).

2. Generating a static CSP from a dynamic JSON (allow users to add domains to the whitelist by updating the JSON file).

3. Generating dynamic JSON (e.g. for nonce and hash directives).

There are two branches:

  master -- Requires PHP 7 and uses strict typing
  v1.x   -- Supports PHP 5
If you have to work with PHP projects, definitely consider integrating CSP-Builder into your workflow. We've integrated it with our open source CMS, Airship (and provided a web interface for managing the whitelist).

1376.

Show HN: CSP-Builder – Content Security Policy Headers Made Easy(github.com ↗)

4 points · by CiPHPerCoder · 10y ago · 1 comment

comment 10y ago · link · parent

> However, one take some key material and calculate HMAC("ChaCha20", key material) and HMAC("Poly1305", key material) and use those keys for the two algorithms.

See also: HKDF

comment 10y ago · link · parent

SHA1 isn't encryption, it's a hash function.

1379.

Show HN: CMS Airship – Secure-By-Default Online Publishing Platform(paragonie.com ↗)

1 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

Interesting! I never imagined someone from DoD would respond to my quick analysis.

In all fairness, JD-GUI wasn't exactly great at reversing the class file to Java code and missed quite a bit. I haven't had a chance to analyze it further.

Is there any chance the DoD could open source this application (e.g. on Github, or some other site)?

1
454647
60