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

comment 10y ago · link · parent

> I don't think 16 bytes is necessary even as insurance against the future.

The birthday problem comes into play here.

If you have 22 bits of entropy in your salt, after 2048 users (2^11) you will find two with the same salt, with 50% probability. If they also use the same password, this makes attacking your users much easier.

Don't make it easy for attackers. Use 16 bytes from a CSPRNG. Better yet: Use a password hashing library that takes care of this for you.

If you use a 128-bit (16-byte) salt, you have a 50% chance of a collision after 2^64 passwords.

comment 10y ago · link · parent

> password encryption

https://paragonie.com/blog/2015/08/you-wouldnt-base64-a-pass...

comment 10y ago · link · parent

If there was any truth at all in that claim, you should be able to compromise paragonie.com right now simply for it running PHP.

Otherwise, that claim is false.

comment 10y ago · link · parent

That question should never even need to be asked. The library you're using should take care of that for you.

In PHP:

    $storeMe = password_hash($plaintext, PASSWORD_DEFAULT);
    if (password_verify($plaintext, $storeMe)) {
        // Logged in
    }
The detail is totally abstracted away. All sane password hashing libraries offer this API.

See: https://paragonie.com/blog/2016/02/how-safely-store-password...

EDIT - CANNOT REPLY:

  > One major failure of this article:
  >
  > You should generate a random salt for each user and store it alongside the user
  > record in the DB.
No, you shouldn't. Your library should do that for you, and store it as a single string that's opaque to the developer.

  > I completely disagree. This implies that my DB ORM handles password stuff,
  > which doesn't make sense.
See the passlib section: https://paragonie.com/blog/2016/02/how-safely-store-password...

comment 10y ago · link · parent

Isn't this by the same folks who brought us Telegram?

comment 10y ago · link · parent

Here's one. Title: How to safely store your users' passwords in 2016.

https://paragonie.com/blog/2016/02/how-safely-store-password...

comment 10y ago · link · parent

I made this because the PEAR website kind of sucks, the Crypt_GPG documents are difficult to navigate, and I wanted a drop-in solution that lets you send an encrypted email to your recipient.

It uses zend-mail from Zend Framework and Crypt_GPG.

All you need to do is:

    $gpgMailer = new GPGMailer(
        new Sendmail(), // Or any other transport
        ['homedir' => '/homedir/containing/keyring']
    );
    $gpgMailer->send(
        $message, // Message object from Zend\Mail
        $fingerprintOrPublicKey
    );
Simple as can be. (There are other steps for, e.g. importing keys in the first place, but that's neither here nor there.)

The license is dual GPL/MIT, so feel free to use it in pretty much anything. It was a minor itch to scratch.

We're using it to optionally encrypt password reset emails in a CMS we're developing:

https://twitter.com/CiPHPerCoder/status/739536854517702660

The password reset feature can be entirely opted out of, too:

https://twitter.com/CiPHPerCoder/status/739537611367276545

1538.

Show HN: GPG-Mailer – send GPG-encrypted emails from your PHP application(github.com ↗)

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

comment 10y ago · link · parent

Time cost and energy cost.

There's a minimum amount of energy needed to flip a bit. https://en.wikipedia.org/wiki/Landauer's_principle

By taking this value, how much energy does it take to brute-force a 256-bit AES key (average case of 2^255 key guesses plus the cost of verification)?

1.59546665 × 10^56 joules

This is about a billion times more energy than our Sun will ever produce.

https://en.wikipedia.org/wiki/Orders_of_magnitude_%28energy%...

comment 10y ago · link · parent

https://github.com/paragonie/awesome-appsec

We've been trying to maintain an up-to-date list.

1541.

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

1 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

I have an Android phone running Cyanogen. I mostly don't install anything ever (other than Signal).

No games, no social media apps, etc. I also have Spotify because I mostly listen to music rather than make phone calls.

I rarely browse the web on my phone, unless I'm testing a mobile application.

I refuse to install Telegram.

comment 10y ago · link · parent

This is a good comparsion. :)

comment 10y ago · link · parent

> As a developer, I feel like I have more control over mitigating CSRF then XSS.

Your feeling is correct. Let me put it this way:

You mitigate SQL injection effectively by making sure no data (user input) can affect the code (SQL query). i.e. Prepared statements.

There is no analogous equivalent for defeating XSS. You have to escape output.

https://paragonie.com/blog/2015/06/preventing-xss-vulnerabil...

Escaping input for SQL injection "works", but has failed pretty hard in the past:

http://stackoverflow.com/a/12118602/2224584

(Character encoding, for the lose.)

By comparison, CSRF is trivial. You use a token that only the client should know, and implement a trivial challenge/response authentication layer onto your HTTP POST APIs, make sure you're using TLS, and call it a day.

comment 10y ago · link · parent

> I don't know anybody who works full-time in software security who thinks HttpOnly is a meaningful defense, but, if you're out there, chime in and make a case for it. :)

I'm going to mostly agree. It's only a meaningful defense against bottom-rung attackers who go after the lowest-hanging of fruit, and if you're susceptible to them, you've probably got bigger problems (in the server-side RCE realm).

And of course, XSS means token-based SSRF/CSRF mitigations are completely toast in the absence of any extra controls (i.e. password re-prompts, CAPTCHAs). Rough and dirty pseudocode PoC for anyone who thinks different:

    // Assuming the token is in the HTML form, and tied to the session.
    // If it's in a cookie, just skip to $.post():
    $.get("/url", {"arg": "value"}, function(data) {
        // ... Grep for token ...
        $.post("/url", {"arg": tokenGoesHere});
        // pwnd
    });
What httpOnly does well is put the burden on the attacker to create a more explicit exploit than "grab the session ID and POST it to this external site so I can swoop in impersonating them at my leisure". They instead need to make the payload do all the commands they intended or connect back to await instructions.

Is that a meaningful security gain? Not in the big scheme of things, no. "Not vulnerable to script kiddie tactics" isn't exactly a bragging right.

The proper fix is, of course, to update your code and remove XSS vulnerabilities.

1546.

Ask HN: How to improve technical writing skills?

10 points · by CiPHPerCoder · 10y ago · 5 comments

comment 10y ago · link · parent

Rutkowska is among the crème de la crème of computer security researchers. That she's dedicating her time towards a project like Qubes is sorely under-appreciated by the public today, but is certainly something that inspires me to believe that, given enough time, defenders can win.

1548.

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

1 points · by CiPHPerCoder · 10y ago · discuss

1549.

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

2 points · by CiPHPerCoder · 10y ago · discuss

1550.

Airship – An open source CMS with secure code delivery(paragonie.com ↗)

3 points · by CiPHPerCoder · 10y ago · discuss

comment 10y ago · link · parent

Or instead of one plot of land, build a sufficiently large seafaring vessel and host it at sea?

comment 10y ago · link · parent

https://paragonie.com/blog

Mostly pertinent to software security and web development. Occasionally covers cryptography topics as well.

I generally submit anything technical to HN, and while most of the time it gets ignored, chances are y'all have seen one or two of them already. :)

comment 10y ago · link · parent

https://archive.is/FEZfj just in case this goes down.

How to untrust this certificate: https://blog.filippo.io/untrusting-an-intermediate-ca-on-os-...

comment 10y ago · link · parent

She was more famous under "Bradley" before she came out as trans. Maybe that rings a bell?

comment 10y ago · link · parent

http://ourincrediblejourney.tumblr.com/ ?

comment 10y ago · link · parent

Remember how 42 is the Ultimate Answer to Life, the Universe, and Everything? And how everyone's searching for the Ultimate Question? I think I've figured it out.

According to Prak, it is impossible for both The Answer and The Question to be known in the same universe; should someone know both the question and the answer, the universe would cease to exist and would be replaced by something more bizarre and inexplicable. The narrator teases the reader that another theory states that this has already happened before.

I posit that the Ultimate Question is, "How many times have the Ultimate Question and Ultimate Answer been known, and thusly the universe been eradicated and replaced by something more bizarre and inexplicable?"

Answer: Forty-two.

https://scott.arciszewski.me/blog/2013/10/ultimate-question-...

comment 10y ago · link · parent

The release process specifically allows an extension to be deprecated and then punted to PECL.

As for frameworks, I and others have already been going around (for years before the mcrypt deprecation came up) switching things to use OpenSSL (and, for that matter, authenticated encryption) instead of mcrypt.

https://paragonie.com/blog/2015/05/if-you-re-typing-word-mcr...

To date: ZF, CodeIgniter, Symfony, Laravel, and CakePHP all support OpenSSL instead of Mcrypt, as do many, many more.

You get E_DEPRECATED in 7.1 then in 7.2 you can still

    pecl install mcrypt
...if you really have a need to support abandonware.

comment 10y ago · link · parent

Wow, yeah. They seriously rewrote it entirely and removed the source link just to maintain the traffic flow from HN? I'd say "flag the article".

EDIT: Dang to the rescue.

comment 10y ago · link · parent

https://github.com/roundcube/roundcubemail/issues/5266

Legacy PHP code (as old as 5.3.7) strikes again.

comment 10y ago · link · parent

It adds no value. It doesn't belong on HN; the original article on dotdev.co does, however.

The "ads by carbon" certainly don't cast this particular website in a good light, either.

1
515253
60