Latest articles

DAuth v0.6.1 - Salted Hashed Password Library

An update to DAuth is out.

Main Changes:

Coming on the horizon: DAuth will be rebranded as "InstaUser Basic". It will be one pillar of a broader multiple-lib project called InstaUser, which will also include optional higher-level tools "InstaUser Store" and "InstaUser Web".

Read more


(Not so) Fun with C

Ever feel nostalgic for the languages of the good ol' days?

$ cat crypt_poop.c #include <stdio.h> #include <crypt.h> void main() { // Bad input. I wonder what happens...? char* hash = crypt("pass", "$salty"); printf("%s\n", hash); } $ gcc crypt_poop.c -lcrypt && ./a.out Segmentation fault

Me neither.

Read more


DualShock 4 On PS3: No Diagonal D-Pad

I can't believe nobody seems to has mentioned this limitation before.

As you may know, Sony's PlayStation 4 controller, the DualShock 4, is technically usable on the PlayStation 3, albeit with a few limitations:

  • No rumble, tilt or touchpad. (Although nothing on PS3 would support the touchpad anyway.)
  • No wireless This limitation was lifted in a recent PS3 system update, although synching it is a bit unintuitive.
  • The PlayStation logo button doesn't work (Except to turn the system or controller on).
  • Face buttons are on/off only, not analog (Very few games ever made much use of this anyway, and it isn't even supported on the PS4 at all.)
  • Not all PS3 games are compatible (Although most are).
  • The directional pad doesn't register diagonal.

That last one is the really interesting one. Most websites and news outlets, and Sony themselves, have been very clear on the rest of the limitations of using a DualShock 4 on a PS3...But I have yet to see anyone mention that last one - the lack of diagonal on the dpad.

Don't believe me? Try it. Go into the "training" mode of any PS3 fighting game and turn on the button input display. Try to get it to register a diagonal with the dpad. Or perform any of Ryu's special moves. Go into Fez, and try climbing diagonally. Try to move diagonally in any PS3 street brawling game, like Castle Crashers or Double Dragon. Can't do it with the PS4's dpad.

Interestingly, the DualShock 4's dpad diagonal does work perfectly fine on the PC.

Everything said, I do still think the DualShock 4 is a fantastic controller. I don't even have a PS4 yet, and I'm still thrilled with my DualShock 4 even just for PC and PS3. (It works much better on the PC than the DualShock 3 did. Plug-n-Play, it just works.)

Luckily, most PS3 games don't actually require using diagonal on the directional pad. Additionally, the improved analog sticks on the DualShock 4 are considerably less terrible as a dpad substitute than any other analog stick I've used. I've always been a die-hard dpad user, but I can even play Street Fighter reasonably well with the DS4's analog sticks - something I've never been able to do on any other controller.

The DualShock 4 is still a great controller and well worth getting, even for just the PS3, but I do think anyone considering a purchase should at least be aware of this limitation.

Read more


Mobile "Me Too" Fashion

Let me tell you a little story.

Microsoft once had a visual style, Aero, that was widely hailed as "good looking". Then Microsoft switched to Metro which was atrociously hideous in both touch-based and "traditional" desktop modes, and a fairly major flop for the company.

Then Apple came along, decided "I must imitate Microsoft's horrible new visual style!" And iOS 7 was born.

Then Google said, "Yes, me too! I have to imitate Microsoft's horrible looking new visual style as well, lest I be the only one left behind in old-fashioned 'good-looking land'". Thus arose Android L.

Now they all look horrid because Silicon Valley can't pull their trendster, hipster, Portlanian heads out the ass of "me too" fashion industry mentality.

Read more


DAuth v0.6 - SHA-2 and Hash_DRBG

DAuth is a low-level authentication library for D with no external dependencies other than D's standard library, Phobos. It provides a simple-yet-flexible API, so your software can easily incorporate secure, upgradable user authentication based on salted password hashes.

By default, DAuth uses known-good hashing and randomization algorithms (currently SHA-512 and Hash_DRBG), but it accepts any Phobos-compatible hash digest or random number generator. You can have as much or as little control as you need, making DAuth suitable for both new projects and interfacing with any existing hashed-password store.

Links:

New in v0.6:

  • Added SHA-2 (hash digest) and Hash_DRBG (cryptographically secure psuedo-random number generator), and set them as the new hash/RNG defaults. DAuth is only a temporary home for these - the SHA-2 implementation has already been merged into phobos master, and I intend to prepare a pull request for the Hash_DRBG. But they're ready-to-use in DAuth in the meantime.
  • Split DAuth into separate modules (using a "package.d" to preserve "import dauth;")
  • Changed callbacks from functions to delegates.
  • Fixed a few bugs, including an error in the dub package file.

Read more