function aes_make_key in AES encryption 5        
                          
                  
                        Same name and namespace in other branches
- 6 aes.module \aes_make_key()
- 7 aes.module \aes_make_key()
1 call to aes_make_key()
  - aes_get_key in ./aes.module
File
 
   - ./aes.module, line 393
Code
function aes_make_key() {
  $acceptable = false;
  $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
  while ($acceptable === false) {
    $key = "";
    while (strlen($key) < 32) {
      $key .= substr($chars, rand(0, strlen($chars)), 1);
    }
    $acceptable = true;
    
    $result = preg_match("/.*[a-z].*/", $key);
    if ($result == 0) {
      $acceptable = false;
    }
    
    $result = preg_match("/.*[A-Z].*/", $key);
    if ($result == 0) {
      $acceptable = false;
    }
    
    $result = preg_match("/.*[0-9].*/", $key);
    if ($result == 0) {
      $acceptable = false;
    }
  }
  return $key;
}