我只有基本的加密和解密知识。
我正在尝试使用 dio_cache_interceptor 包在我的应用中实现加密。
这是我的缓存选项的样子
_options = CacheOptions(
// A default store is required for interceptor.
store: kIsWeb?MemCacheStore():HiveCacheStore(path),
// Default.
// Optional. Returns a cached response on error but for statuses 401 & 403.
hitCacheOnErrorExcept: [401, 403],
// Optional. Overrides any HTTP directive to delete entry past this duration.
maxStale: const Duration(days: 1),
// Default. Allows 3 cache sets and ease cleanup.
priority: CachePriority.high,
// Default. Body and headers encryption with your own algorithm.
cipher: null,
// Default. Key builder to retrieve requests.
keyBuilder: CacheOptions.defaultCacheKeyBuilder,
// Default. Allows to cache POST requests.
// Overriding [keyBuilder] is strongly recommended.
allowPostMethod: true,
policy: cachePolicy
);
在密码参数中,我应该以这种形式传递我自己的加密/解密函数,它返回一个列表
(列表字节){};
如何加密和解密列表?