Thread: Encryption Algorithms

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Banned borko_b's Avatar
    Join Date
    Jun 2002
    Location
    Well... I live in Bulgaria :)
    Posts
    100
    hmmm...

    Here 's a good XOR of mine...

    Code:
    DWORD CreateKey(char *password) {
       const char *pstr;
       DWORD key;
       pstr = password;
       for (key = 0; (*pstr); ++pstr) {
            key *= 16777619;
            key ^= *pstr;
       }
       return key;
    }
    
    
    DWORD key = CreateKey("my secret password string!");
    char val[301];
    
    char *pv = val;
    
    srand(key); //..or any other set of pseudo rand fuctions
    while(*pv) {
         *pv ^= rand() % 255; /*replace with your own randomizer if 
    you wish*/
         pv++;
    }
    Last edited by borko_b; 06-20-2002 at 03:06 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. What's wrong with my Stream Cipher Encryption?
    By Davros in forum C++ Programming
    Replies: 3
    Last Post: 04-18-2002, 09:51 PM
  3. relative strength of encryption algorithms (blowfish, des, rinjdael...)
    By duck-billed platypus in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-30-2001, 04:20 PM
  4. File Encryption & Read/Write in Binary Mode
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 11-30-2001, 06:45 PM
  5. Encryption Algorithms
    By bljonk in forum C Programming
    Replies: 3
    Last Post: 11-07-2001, 09:21 AM