salt and hash in plain C or C++

Started by
1 comment, last by KnolanCross 11 years, 6 months ago
I'm trying to write an interface to my database on Cloudant using C++ and cUrl. I've been able to query stuff and run GET requests, and I've been able to POST documents and databases to create them. But now I'm trying to store users in the _users database. I've created the _users database and now I want to be able to add users to it. The problem is that Cloudant wants you to salt and hash the password on your side:
http://support.cloudant.com/customer/portal/articles/359311-users-authorization-on-cloudant but from C++ (on Android and Windows) I can't run those commands that they show.
Advertisement
Crypto++ is a high quality, free license cryptographic library for C++.
The command they use to generate a salt is basically just a high quality random number generator (which is included in Crypto++ if your OS supports something like the crypto random number service or /dev/random.)
The command they use for hashing the key just shows that they use the hex encoding of the sha1 hash of the password, which is a medium-strength hash function (well supported in Crypto++.)
enum Bool { True, False, FileNotFound };
They are using openSSL, it is an open source library, you can download it here http://www.openssl.org/ .

Currently working on a scene editor for ORX (http://orx-project.org), using kivy (http://kivy.org).

This topic is closed to new replies.

Advertisement