if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()) {//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
// force the user to re-loggin if the encryption key isn't unlocked
// (happens when a user is logged in before the encryption app is enabled)
if ( ! isset($_SESSION['enckey']) and OCP\User::isLoggedIn()) {
// - Add a setting "Don´t encrypt files larger than xx because of performance reasons"
// - Transparent decrypt/encrypt in filesystem.php. Autodetect if a file is encrypted (.encrypted extension)
// - Don't use a password directly as encryption key. but a key which is stored on the server and encrypted with the user password. -> password change faster
// - Don't use a password directly as encryption key, but a key which is stored on the server and encrypted with the
// user password. -> password change faster
// - IMPORTANT! Check if the block lenght of the encrypted data stays the same
@ -45,12 +46,12 @@ class OC_Crypt {
public static function init($login, $password) {
$view=new OC_FilesystemView('/');
if(!$view->file_exists('/'.$login)) {
if(!$view->file_exists('/'.$login)) {
$view->mkdir('/'.$login);
}
OC_FileProxy::$enabled=false;
if(!$view->file_exists('/'.$login.'/encryption.key')) {// does key exist?
if(!$view->file_exists('/'.$login.'/encryption.key')) {// does key exist?