flutter_3des_plugin

A new flutter plugin project.

Getting Started

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Add Dependency (引入)

dependencies:
  flutter_3des_plugin: ^0.0.3

Implementation (使用)

import 'package:flutter_3des_plugin/flutter_3des_plugin.dart';

/*
 * 1. 目的: 该插件为 ECB模式 3des 加密, 解决 flutter => java后台 => 硬件 相联系的需求 (需保证App端、服务端、硬件三方加密结果一致);
 * 2. 现有的 pub.dev 插件如(flutter_3des, flutter_des, des_plugin)加密后的结果均和 java、硬件加密的结果不一致, 故诞生了这个3des加密插件。
 * 3. 后续加入解密, 以及base64模式加密、解密
 * 4. 有问题或者疑问,可前往 github (https://github.com/laijinxian/flutter_3des_plugin)提 Issues; 或者前往掘金(https://juejin.im/post/5eea1264e51d4574073b4a8a)留言
 */
void example() async {
  const data = "2005261620000123";
  const key = "FC1900000123200526162055AA5A5AA5";

  Flutter3desPlugin.encrypt(key, data).then((res) {
    // TODO: res就是加密后的数据
    print(res)
  });
}

Libraries

flutter_3des_plugin