|
|
|
|
@ -637,28 +637,4 @@ class Crypt {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param $legacyEncryptedContent
|
|
|
|
|
* @param $legacyPassphrase
|
|
|
|
|
* @param $publicKeys
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public static function legacyKeyRecryptKeyfile($legacyEncryptedContent, $legacyPassphrase, $publicKeys) {
|
|
|
|
|
|
|
|
|
|
$decrypted = self::legacyBlockDecrypt($legacyEncryptedContent, $legacyPassphrase);
|
|
|
|
|
|
|
|
|
|
// Encrypt plain data, generate keyfile & encrypted file
|
|
|
|
|
$cryptedData = self::symmetricEncryptFileContentKeyfile($decrypted);
|
|
|
|
|
|
|
|
|
|
// Encrypt plain keyfile to multiple sharefiles
|
|
|
|
|
$multiEncrypted = Crypt::multiKeyEncrypt($cryptedData['key'], $publicKeys);
|
|
|
|
|
|
|
|
|
|
return array(
|
|
|
|
|
'data' => $cryptedData['encrypted'],
|
|
|
|
|
'filekey' => $multiEncrypted['data'],
|
|
|
|
|
'sharekeys' => $multiEncrypted['keys']
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|