/// /// Enc/Dec JSON implementation /// import 'dart:convert'; import 'package:letusmsg/ccc/crypto_abstract.dart'; /// Plaintext JSON codec used for testing/development flows. /// /// This class intentionally does not provide cryptographic protection. class EncDecJson implements CryptoAbstract> { @override String get providerName => 'EncDecJson'; @override bool get isPlaintextMode => true; // @override // List pre(String input) { // return utf8.encode(input); // } @override Future> encrypt(Map data, {CryptoContext? context}) async { // Simulate encryption delay // await Future.delayed(Duration(milliseconds: 100)); return utf8.encode( jsonEncode(data) ); } @override Future> decrypt(List encdata, {CryptoContext? context}) async { // Simulate decryption delay // await Future.delayed(Duration(milliseconds: 100)); return jsonDecode(utf8.decode(encdata)); } // @override // String post(List output) { // return utf8.decode(output); // } }