You are here

function backup_migrate_filter_encryption::aes_decrypt in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.2 includes/filters.encryption.inc \backup_migrate_filter_encryption::aes_decrypt()
  2. 8.3 includes/filters.encryption.inc \backup_migrate_filter_encryption::aes_decrypt()
  3. 6.2 includes/filters.encryption.inc \backup_migrate_filter_encryption::aes_decrypt()
  4. 7.3 includes/filters.encryption.inc \backup_migrate_filter_encryption::aes_decrypt()
  5. 7.2 includes/filters.encryption.inc \backup_migrate_filter_encryption::aes_decrypt()

Gzip decode a file.

1 call to backup_migrate_filter_encryption::aes_decrypt()
backup_migrate_filter_encryption::file_decrypt in includes/filters.encryption.inc
Decompress a file with the given settings. Also updates settings to reflect new file mime and file extension.

File

includes/filters.encryption.inc, line 111
A filter for encrypting bckups with AES.

Class

backup_migrate_filter_encryption
A filter for encrypting backup files.

Code

function aes_decrypt($source, $dest) {
  $success = FALSE;
  if (function_exists('aes_decrypt')) {
    if ($data = $source
      ->get_contents()) {
      if ($data = aes_decrypt($data, FALSE)) {

        // Trim all the padding zeros plus our non-zero marker.
        $data = substr(rtrim($data, "\0"), 0, -1);
        $dest
          ->put_contents($data);
        $success = TRUE;
      }
    }
  }
  return $success;
}