Code Monkey home page Code Monkey logo

dart_des's People

Contributors

akash98sky avatar delletenebre avatar francisco-diniz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dart_des's Issues

RangeError (index): Invalid value: Not in inclusive range 0..63: 64

when my sourceStr is Chinese, it will be appeard this error。

mycode

`
test("register2", () async {
var map = "猫";
String encryptDart = await EncryptUtil.encryptDartDes(map.toString(), "");
print(encryptDart);
});

static String encryptDartDes(String srcStr, String dateStr) {
String keyStr = "12345678";
final key = keyStr.codeUnits;
final iv = keyStr.codeUnits;
DES desCBC = DES(key: key, mode: DESMode.CBC, iv: iv, paddingType: DESPaddingType.PKCS7);

final encrypted = desCBC.encrypt(srcStr.codeUnits);
return base64.encode(encrypted);

}`

errors:
`

dart:core List.[]
package:dart_des/dart_des.dart 1009:27 DES.xor
package:dart_des/dart_des.dart 1105:19 DES.crypt
package:dart_des/dart_des.dart 1126:7 DES.encrypt
package:project_flutter/utils/encrypt_util.dart 46:30 EncryptUtil.encryptDartDes
test\api_test.dart 40:44 main.
test\api_test.dart 38:21 main.

RangeError (index): Invalid value: Not in inclusive range 0..63: 64

`

encrypt error

DES3 des3CBC = DES3(key: 'PDXDzTttJ1F4lgEsoR4xPB9U'.codeUnits, mode: DESMode.CBC, iv: utf8.encode('OoWrs7by'));
final encryptData = des3CBC.encrypt('{"keyword":"hello","page":"1","userToken":""}'.codeUnits);
String encryptString = base64Encode(encryptData);
print(encryptString);

with this code, I get error

@delletenebre
please help me~ thanks so much!!

Padding mode

In the case that I'm working I need to use padding mode but I don't see how to use it in the example code. Can you tell me how to use it if I need to use PKCS7 padding mode?

Wrong decrypt result

Hi guys,

I can decrypt the message but it always has some strange characters at the end such as ��

I have function like this:

Future<String> decryptTDES(String data, String password) async {
      List<int> iv = [0, 0, 0, 0, 0, 0, 0, 0];
      List<int> decrypted;
      DES3 des3CBC = DES3(key: md5.convert(utf8.encode(password)).bytes, mode: DESMode.CBC, iv: iv);
      decrypted = des3CBC.decrypt(base64.decode(data));
      return utf8.decode(decrypted);
  }

And it also takes so long time (~30-45s) to decrypt a message 1200 characters (base64 format)
Can someone help me?

can dart_des 1.0.0 compatible 0.0.2 ?

hi sir,

I'am working on a project that phone communicate with stm32 MCU by bluetooth(BLE) ,
I encrypted byte arrays with dart_des 0.0.2 , it encrypted 8bytes data and got 8bytes encrypted data, I like it because I don't want the encrypted data length got too long, but now the dart_des 1.0.0 is different, it encrypt 8 bytes data and got 16 bytes data, it's hard to send data to stm32 mcu, so could I want to know it's possible to compatible with 0.0.2 version and also get null safety feature ?

Thanks in advance .

kitty

16 byte key doesn't work

I'm having a problem regarding to the length of the key. At the case that I'm currently working on I have to use 16 byte key, but I keep getting an exception that the key must be 8 byte long even though that I've followed the exact same snippet from the documentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.