Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crypt Unix API function
02-13-2010, 10:32 PM (This post was last modified: 02-13-2010 10:42 PM by codecaine.)
Post: #1
Crypt Unix API function
Algorithm:
The salt introduces disorder in the DES algorithm in one of 16777216 or
4096 possible ways (ie. with 24 or 12 bits: if bit i of the salt is set,
then bits i and i+24 are swapped in the DES E-box output).

The DES key is used to encrypt a 64-bit constant, using count iterations
of DES. The value returned is a null-terminated string, 20 or 13 bytes
(plus null) in length, consisting of the salt, followed by the encoded
64-bit encryption.

PHP Code:
#include <iostream>
#include <string>
#include <unistd.h> 

using namespace std;

/* This program shows you how to use the crypt api function which is DES encryption from unistd in unix base system
   coded by codecaine aka Jerome Scott II
                                                                                        */

int main(int argccharargv[])
{
    
string password//password field
    
string salt//salt to use for encryption max size is 2 characters in length when used in crypt function
    
string encryption//holds the value of encryption string
    
    //get password from user
    
cout<<"Enter Passsword"<<endl;
    
cin>>password;
    
    
//get salt from user
    
cout<<"Enter Salt"<<endl;
    
cin>>salt;
    
    
//encrypt string using password and salt
    
encryption crypt(password.c_str(),salt.c_str());
    
    
//show the encryption string hash
    
cout<<"Salt Hash: "<<encryption<<endl;
    return 
0;


Side note if you do encryption.sub(2,encryption.length()) this will take out the salt key in the salt hash and would make it a bitch to try to crack.


Attached File(s)
.zip  crypt.cpp.zip (Size: 569 bytes / Downloads: 3)
Visit this user's website Find all posts by this user
Quote this message in a reply
02-14-2010, 12:12 AM
Post: #2
RE: Crypt Unix API function
I can say that is strong encryption ! Very good API !

There's a fine line between genius and insanity. I have erased this line.
Oscar Levant
There's a fine line between an administrator and black hat hacker. I have erased this line.
Dr DEBCOL
Visit this user's website Find all posts by this user
Quote this message in a reply
02-14-2010, 09:25 AM
Post: #3
RE: Crypt Unix API function
Woah, does Windows have anything similar to this?

"Character is determined more by the lack of certain experiences than by those one has had."
Friedrich Nietzsche
Visit this user's website Find all posts by this user
Quote this message in a reply
02-14-2010, 10:40 AM
Post: #4
RE: Crypt Unix API function
(02-14-2010 09:25 AM)Back_track Wrote:  Woah, does Windows have anything similar to this?

yea serveral lines of code using their crypted api lol it is a pain in the ass.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: