Skip to content

Commit

Permalink
[13982] OpenSSL Enryptor hinzufügen
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Krahmer committed Apr 13, 2023
1 parent f5be275 commit 15893ef
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Encryptors/OpenSSLEncryptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,25 @@ public function decrypt($data) { //TODO data = null
return openssl_decrypt($data, self::METHOD, $this->password, self::OPTIONS, $this->iv);
}

/**
* {@inheritdoc}
*/
public function encryptFile($inputFile, $outputFile)
{

return file_put_contents($outputFile, $this->encrypt(file_get_contents($inputFile)));
}

/**
* @param $inputFile
* @param $outputFile
* @return bool
*/
public function decryptFile($inputFile, $outputFile)
{
return file_put_contents($outputFile, $this->decrypt(file_get_contents($inputFile)));
}

private function getKey()
{
if($this->keyFile == null || $this->keyFile==""){
Expand Down

0 comments on commit 15893ef

Please sign in to comment.