M_Crypto (formerly Blowfish and Bcrypt project)

  1. ‹ Older
  2. 2 years ago

    Kem T

    4 Oct 2017 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    I just released v.2.2, now with GenerateUUID and a separate Scrypt module. Read about Scrypt here:

    https://en.wikipedia.org/wiki/Scrypt

  3. Kem T

    5 Oct 2017 Pre-Release Testers, Xojo Pro, XDC Speakers New York
    Edited 2 years ago

    I just posted 2.2.1. The only difference is a dramatic speedup of Scrypt by a factor of about 3. It turns out using a MemoryBlock is way faster than copying values to and from an array.

    In 64-bit aggressive, the Scrypt test took about 1.0s. Now it takes about 0.33s. In 32-bit, it went from about 3.5s to 1.5s.

  4. Kem T

    15 Oct 2017 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    I found a bug that could lead to a crash. I'll release an update soon, but in the meantime, look in AES_MTC.InitMultiplyTables. In the loop, change the upper bound from 256 to 255.

      for i as integer = 0 to ptrs.Ubound
        dim p as ptr = ptrs( i )
        dim v as integer = values( i )
        
        for x as integer = 0 to 255 // <-- was 256, a bad, bad value
          p.Byte( x ) = Multiply( x, v )
        next
      next
  5. Kem T

    16 Oct 2017 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    Version 2.3 is out. The release notes:

    • Harness now allows multiple encryption windows.
    • Encryption window hides the encryption key unless that field has focus.
    • Fixed bug in AES that could lead to a crash (using a Ptr to overwrite the bounds of a MemoryBlock by one byte).
    • Refactored around new framework MemoryBlock.
    • Quicker initialization for AES.
  6. Kem T

    17 Oct 2017 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    I've been trying to figure out why AES decryption was so much slower (relatively speaking) than encryption. In 64-bit, encrypting 30k took about 2 ms with AES-256-CBC while decryption took about 40 ms. It turns out that I just forgot to add pragmas to the InvCipher method. It's in the develop branch now, or you can just add this to the top of the method:

    #if not DebugBuild
      #pragma BackgroundTasks False
      #pragma BoundsChecking False
      #pragma NilObjectChecking False
      #pragma StackOverflowChecking False
    #endif
  7. Kem T

    6 Nov 2017 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    v.2.4 is out.

    Release notes:

    • Added pragmas that dramatically increase the speed of `AES_MTC` decryption.
    • The same instance of an `M_Crypto.Encrypter` is now safe to use in multiple threads. Just don't change the key or Initial Vector of that instance.
    • More efficient handling of the current vector in `AES_MTC`.
    • Better description in CLI help.
    • Removed unneeded property in `M_Crypto.Encrypter`.
  8. 9 months ago

    Perry F

    1 Oct 2018 Pre-Release Testers
    Edited 9 months ago

    Hey, great set of classes, much appreciated! I have one issue/question. I am trying to switch from the MBS Blowfish plugin to your classes. I have some text that was encrypted using BlowfishMBS.Encrypt("key",string).

    But when I take that encrypted output and plug it into your class, trying to decode with Blowfish, I always get the following error:

    Data blocks must be an exact multiple of BlockSize

    Am I doing something wrong, or is there something off about the MBS Blowfish implementation? Are your classes simply not compatible with MBS encryption output? I've tried every variation of settings I an in your example project, but it always results in the same error.

    Any assistance would be most appreciated. Thank you.

  9. Kem T

    1 Oct 2018 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    Can you paste as hex the output you're trying to decrypt? It might be that his implementation handles padding differently, but blowfish is blowfish.

  10. Perry F

    1 Oct 2018 Pre-Release Testers

    I'm encrypting "hello, world" with MBS Blowfish using a key, and the output is "ÑU1ç∏MTkÏ∂≤Õ" (without the quotes). MBS Blowfish decrypts it just fine.

    Thanks for the quick response!

  11. Kem T

    1 Oct 2018 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    Using what key? And please paste the data as hex or Base64. Binary does not translate well to a forum.

  12. Perry F

    1 Oct 2018 Pre-Release Testers

    I don't know how to get the data as hex or base64. Please excuse my ignorance, I don't know much about encryption. I'm going to generate a new encrypted string with a new key. MBS Encrypt only gives me the data in the format I sent. Here is the new test:

    Plain text string: "hello, world"
    Key: "TNLAC9XOFC3ZY714761905"
    The output MBS gives me: "!∫–√Ödÿ{Ω≤"

    Let me know what I need to do to give you the entry in base64 or hex. I've always just stored the output directly from MBS and it worked fine. I do use ConvertEncodings.UTF on the string first.

    Thank you very much.

  13. Kem T

    1 Oct 2018 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    I can reproduce the problem here. MBS produces 14 bytes of output, but Blowfish expects blocks in multiples of 8, so I don't know how he's padding internally or what other algorithm he might have applied. Perhaps @ChristianSchmitz can shed more light.

  14. Perry F

    1 Oct 2018 Pre-Release Testers

    Hmm that is strange. Bummer. Well thank you very much for looking into this.

  15. Kem T

    1 Oct 2018 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    I can tell you that I've tested my classes against other implementations with no compatibility issues.

  16. 8 months ago

    Perry F

    2 Oct 2018 Pre-Release Testers
    Edited 8 months ago

    I definitely believe you made it universal and compatible. I wonder if MBS does something to make it proprietary. Which would be a drag honestly. I’ll have to figure out some alternate method to get old encrypted data out and use your standard encryption algorithm going forward. No idea yet what I’ll do but I’ll figure something out.

    Thanks again for your help.

  17. Kem T

    2 Oct 2018 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    For advice on how to encrypt stuff securely, see here:

    https://forum.xojo.com/50188-tip-encrypting-stuff

  18. Perry F

    2 Oct 2018 Pre-Release Testers

    Thank you, much appreciated. I’m just encrypting Data in a database, but I will continue researching more about encryption.

    My main issue is getting data encrypted with MBS on 32 bit to be readable by new 64 bit builds. I may need to include a bundled 32 bit helper to decrypt MBS, but that will only work until 32 bit apps are completely killed next year.

    Again, thanks for your help. Much appreciated.

  19. 7 months ago

    Kem T

    15 Nov 2018 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    I've just released v.2.5, found here:

    https://github.com/ktekinay/M_Crypto

    This release includes SHA256Digest_MTC and SHA512Digest_MTC classes that will let you calculate those respective hashes in blocks.

  20. Kem T

    16 Nov 2018 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    And now it's up to v.2.5.1 with optimizations that speed up the new digest classes by a factor of ~10x.

  21. Newer ›

or Sign Up to reply!