Giter VIP home page Giter VIP logo

python-camellia's People

Contributors

varbin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-camellia's Issues

Camellia Decryption issues

Currently trying to decrypt cipher text from WolfSSL implementation. Your implementation is having trouble decrypting despite both you and WolfSSL using the Nippon encrypt and decrypt source code for Camellia.

import camellia 
key = b'SzE6pcNdUGbF0nVTNjqDj79v8JwBf7P2'
iv = b'\xd7\xfe3\x1d\x10\x85&^\xe6\x12p\xf8GZ\xb2\xa4'
salt = 'b\xc41\xa6\x8d\xa1b\x00'
cipher_text = b'\xb5\x7f\xbdpkkF\xef1\xbfX\xaf\x94\xf0\xec|V\xe4\xa8\xbe\x1a0B\xa8\x04Aq\x84\xd4\xa6M\xf8\x13\x9e<=\xbd\x1cbD\xdd\x82\xbe\\\x94\xf4m('

new_key = hashlib.pbkdf2_hmac('sha256', key, salt, 4096)

c2 = camellia.CamelliaCipher(key=key, IV=bytes(iv), mode=camellia.MODE_CBC)

print("decrypt >>>> ", c2.decrypt(encrypted).decode() )

This should decrypt to "Hello there, you decrypted the string"

PEP-272

Make code PEP 272 compliant (API for Block Encryption Algorithms v1.0).

Current status:

  • new method as an alternative constructor (with 053455c)
  • ECB mode of operation
  • CBC mode of operation
  • CFB mode of operation (with d26b370)
  • OFB mode of operation (with d26b370)
  • CTR mode of operation
  • Different attributes of the CamelliaCipher class (with 227ef7e)
    • block_size
    • IV
  • key_size variable (with 4e69c1e)
  • block_size variable (with 4e69c1e)

Sources:

32 bit Python incorrectly tries to load 64 bit dll

The code checks for the camellia dll of your current architecture. However, it gets the architecture of the system, not the architecture of the currently running Python. When using 32 bit Python it tries to open camellia-win32-AMD64-WindowsPE.dll, which fails.

CTR mode not supported

Hi,
When I use CBC mode, it works but when I use CTR as follows:
camellia.CamelliaCipher(key=b'16 byte long key', IV=b'16 byte iv. abcd', mode=camellia.MODE_CTR)

I get the following error:
NotImplementedError: This mode is not supported!

Could you help me with this, please!

Optimize how camellia.c is loaded

Possible solutions are:

  • C-Extension (platform independent way, not that good on PyPy, )
  • CFFI (good on PyPy, also on CPython)
  • Cython (CPython only!, slow on PyPy)
  • SWIG (Difficult to install and compile, probably bad user experience, especially on systems without integrated package managers)

=> All solutions will drop IronPython and Jython support. Proper .NET or Java libraries should be used in Jython/IronPython.

Use other Camellia implementation

Currently, python-camellia uses the official reference implementation. This is not optimized in any way. The official statement (by the camellia authors) is:

This reference code is written for an easy understanding of the Camellia
encryption algorithm and a tool for validity verification of a source code that you made.
It is not intended to be used for a specific application.
No optimized techniques are adopted at all in this code.

In future versions,

Crypto engine for Camellia (C [mini], BSD License)

will be used.

Current Status:

  • Unix-like
  • Windows (only recompile needed!)

Sources:

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.