}\r
}\r
\r
- /**\r
- * @param $legacyEncryptedContent\r
- * @param $legacyPassphrase\r
- * @param $publicKeys\r
- * @return array\r
- */\r
- public static function legacyKeyRecryptKeyfile($legacyEncryptedContent, $legacyPassphrase, $publicKeys) {\r
-\r
- $decrypted = self::legacyBlockDecrypt($legacyEncryptedContent, $legacyPassphrase);\r
-\r
- // Encrypt plain data, generate keyfile & encrypted file\r
- $cryptedData = self::symmetricEncryptFileContentKeyfile($decrypted);\r
-\r
- // Encrypt plain keyfile to multiple sharefiles\r
- $multiEncrypted = Crypt::multiKeyEncrypt($cryptedData['key'], $publicKeys);\r
-\r
- return array(\r
- 'data' => $cryptedData['encrypted'],\r
- 'filekey' => $multiEncrypted['data'],\r
- 'sharekeys' => $multiEncrypted['keys']\r
- );\r
-\r
- }\r
-\r
}
\ No newline at end of file
}
- /**
- * @brief test decryption using legacy blowfish method
- * @depends testLegacyEncryptLong
- */
- function testLegacyKeyRecryptKeyfileEncrypt($crypted) {
-
- $recrypted = Encryption\Crypt::LegacyKeyRecryptKeyfile($crypted, $this->pass, array($this->genPublicKey));
-
- $this->assertNotEquals($this->dataLong, $recrypted['data']);
-
- return $recrypted;
-
- # TODO: search inencrypted text for actual content to ensure it
- # genuine transformation
-
- }
-
function testRenameFile() {
$filename = 'tmp-' . time();