Example #1
0
gchar *password_decrypt_old(const gchar *password)
{
	if (!password || strlen(password) == 0) {
		return NULL;
	}

	if (*password != '!' || strlen(password) < 2) {
		return NULL;
	}

	gsize len;
	gchar *decrypted = g_base64_decode(password + 1, &len);

	passcrypt_decrypt(decrypted, len);
	return decrypted;
}
static gchar *pass_decrypt(const gchar *input)
{
	gchar *output;

	if (input[0] == '!') {
		gsize len;
		gchar *dec;

		dec = (gchar *) g_base64_decode(&input[1], &len);
		passcrypt_decrypt(dec, (guint) len);
		output = dec;
	} else {
		output = g_strdup(input);
	}

	return output;
}