Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

feat: add method to decrypt delete challenge for account deletion process

AmanRajSinghMouryaae4c44a3de08
diff --git a/mobile/packages/configuration/lib/base_configuration.dart b/mobile/packages/configuration/lib/base_configuration.dart
index 858d6c22d8..c48708bf37 100644
--- a/mobile/packages/configuration/lib/base_configuration.dart
+++ b/mobile/packages/configuration/lib/base_configuration.dart
@@ -369,6 +369,15 @@ abstract class BaseConfiguration {
return _secretKey == null ? null : CryptoUtil.base642bin(_secretKey!);
}
+ String decryptDeleteChallenge(String encryptedChallenge) {
+ final challenge = CryptoUtil.openSealSync(
+ CryptoUtil.base642bin(encryptedChallenge),
+ CryptoUtil.base642bin(getKeyAttributes()!.publicKey),
+ getSecretKey()!,
+ );
+ return utf8.decode(challenge);
+ }
+
Uint8List getRecoveryKey() {
final keyAttributes = getKeyAttributes()!;
return CryptoUtil.decryptSync(