py3rijndael | Rijndael algorithm library for Python3 | Learning library

 by   meyt Python Version: 0.3.3 License: MIT

kandi X-RAY | py3rijndael Summary

kandi X-RAY | py3rijndael Summary

py3rijndael is a Python library typically used in Tutorial, Learning applications. py3rijndael has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install py3rijndael' or download it from GitHub, PyPI.

Rijndael algorithm library for Python3
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              py3rijndael has a low active ecosystem.
              It has 11 star(s) with 4 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 1 open issues and 1 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of py3rijndael is 0.3.3

            kandi-Quality Quality

              py3rijndael has 0 bugs and 7 code smells.

            kandi-Security Security

              py3rijndael has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              py3rijndael code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              py3rijndael is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              py3rijndael releases are not available. You will need to build from source code and install.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              It has 485 lines of code, 20 functions and 9 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed py3rijndael and discovered the below as its top functions. This is intended to give you an instant insight into py3rijndael implemented functionality, and help decide if they suit your requirements.
            • Multiply two bits
            • Multiply a and b
            • Multiply two values
            Get all kandi verified functions for this library.

            py3rijndael Key Features

            No Key Features are available at this moment for py3rijndael.

            py3rijndael Examples and Code Snippets

            No Code Snippets are available at this moment for py3rijndael.

            Community Discussions

            QUESTION

            AES - changing a string to byte resulting in extra "/" how to avoid it
            Asked 2021-Jan-19 at 12:26
            import unittest
            import base64
            from py3rijndael import Rijndael
            import os
            import codecs
            #plain text
            a=input("Please Enter Plain text: ")
            plain_text = a.encode('utf-8')  
            padded_text = plain_text.ljust(32, b'\x1b')
            
            #key
            
            key=input()
            key_bytes =  codecs.encode(key, 'UTF-8')
            #key_bytes = key.encode('utf-8') #two change string to byte
            #base64_key_bytes = base64.b64encode(key_bytes) #base  64 encryption
            key_bytes = key_bytes[2:-1]
            print(key_bytes)
            
            #encryption
            rijndael_key = Rijndael(key_bytes, block_size=32)
            cipher = rijndael_key.encrypt(padded_text)
            print(cipher)
            
            ...

            ANSWER

            Answered 2021-Jan-19 at 12:26

            Guess you are using python3. (It's totally different on python2 and python3.)

            Firstly, let's try to explain why it happens.

            You copy a b"\x08\xda... from else where and paste it to prompt. input will return an str object (unicode of python2), whose first char is 'b', second is '"', third is '\', forth is 'x', etc.

            When it encodes, it becomes a byte string with same characters(represented in bytes), as there are only ascii chars.

            Then there is print. What is a byte '\' be printed? It's printed as b'\\' that's why you see double back slashes.

            An easy (but dangerous) way.

            After reading from prompt, eval it. That is, execute it just like python codes. And then you will get what it was when it was first generated by random. In fact input in python2 did this for you.

            But this is of course insecure because the input your users give may contain any possible string and it may contains some malicious snippet.

            A better way I can think of.

            As a key is always byte string, and byte strings are generally unprintable. So you need to transform it to something printable, copy-and-paste it here, and de-transform it back. maybe base64 encoding may help you do this.

            Source https://stackoverflow.com/questions/65789820

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install py3rijndael

            You can install using 'pip install py3rijndael' or download it from GitHub, PyPI.
            You can use py3rijndael like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install py3rijndael

          • CLONE
          • HTTPS

            https://github.com/meyt/py3rijndael.git

          • CLI

            gh repo clone meyt/py3rijndael

          • sshUrl

            git@github.com:meyt/py3rijndael.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link