/** * {@inheritDoc} * @see \Mdanter\Ecc\Crypto\EcDH\EcDHInterface::decryptFile() */ public function decryptFile($path) { if (file_exists($path) && is_readable($path)) { $cipherText = $this->messages->ciphertext(file_get_contents($path)); return $cipherText; } throw new \InvalidArgumentException("File '{$path}' does not exist or is not readable."); }
/** * @param $content * @return int|string */ private function hash($content) { $messages = new MessageFactory(MathAdapterFactory::getAdapter()); return $messages->plaintext($content, 'sha256')->getHash(); }