diff --git a/lib/services/collections_service.dart b/lib/services/collections_service.dart index 594ee5ffebea014a1e148d16562e1005e72d1269..95a525a4026e0648595a39260b7d049868a77048 100644 --- a/lib/services/collections_service.dart +++ b/lib/services/collections_service.dart @@ -320,9 +320,12 @@ class CollectionsService { } String decryptCollectionPath(Collection collection) { + final key = collection.attributes.version != null + ? getCollectionKey(collection.id) + : _config.getKey(); return utf8.decode(CryptoUtil.decryptSync( Sodium.base642bin(collection.attributes.encryptedPath), - _config.getKey(), + key, Sodium.base642bin(collection.attributes.pathDecryptionNonce))); } }