Questions tagged [python-cryptography]

python-cryptography is a python library for secure cryptographic services. The module includes both high level recipes and low level interfaces to common cryptographic algorithms such as symmetric ciphers, message digests, and key derivation functions.

231 questions
0
votes
1 answer

Why is my mean value of the sum of the index of coincidence wrong in Python3?

I made a program to try and find the length x of a key in a French vigenere ciphered text (should be a random string) by calculating the mean of all the index of coincidence of a text which is cut every x element, basically I'm trying to get the…
0
votes
1 answer

SwiftyRSA && Python's cryptography for signature verification

I am trying to sign a piece of text using a private key using SwiftyRSA, which I do successfully. Then send the signature to the python server which holds the public key for verification. the But I keep receiving the InvalidSignature exception. I…
0
votes
1 answer

Python cryptography Fernet.generate_key() key length

I don't know much about cryptography but when I used cryptography library in python and tried generating a key, the key length was above 32 from cryptography.fernet import Fernet import base64 key =…
Angelo
  • 122
  • 1
  • 10
0
votes
1 answer

JSON and Cryptography With Python: TypeError: Object of type bytes is not JSON serializable

What am I doing wrong here? I am trying to encrypt usernames and passwords but when I put them into json I get this error. Any help will be welcome! Sorry for any trouble! Python 3.7.0 I don't know the cryptography verson. def editjson(location,…
user13218235
0
votes
1 answer

Buildozer fails when using Cryptography module

i'm getting this error when including cryptography module in my kivy app, here's the entire error my buildozer.specs file:- [app] # (str) Title of your application title = My Application # (str) Package name package.name = myapp # (str)…
0
votes
0 answers

Auto-Decryption Question from Computer Science Circles (Python)

I'm doing this exercise from computer science circle. Here's the information: Write a program which does the following. First, it should read one line of input, which is the encoded message, and will consist of capital letters and spaces. Your…
0
votes
1 answer

Python ECDH with Cryptography Problem Public Key

Currently I started working with the cryptography framework on python. I'm trying to build a SSH Suit by my own but I ran into some problem with the library. I'm trying to build my own Elliptic Curve Key Exchange Init Packet (with scapy). I'm trying…
EviLDgL
  • 3
  • 2
0
votes
0 answers

FERNET Error : cryptography.fernet.InvalidToken

I'm using python Fernet library because I need to encrypt and store a password in the db, then I need to query the encrypted password and decrypt it to pass it into a variable, this is an FTP password the application needs to do some stuff. Since I…
0
votes
0 answers

New to REST API and P12 certificates in Python and Requests

I was hoping to get some help in making a API Get request using the requests library via Python as I want to automate some API test scripts. I have access to the requests library but was wondering what is the proper syntax to authenticate a .p12…
0
votes
1 answer

Python cryptograpy.fernet doesn't decrypt symbols properly as expected

Folks, I'm writing a simple cli tool to encrypt a text and decrypt based on the passed arguments. It works fine when I use only text. But It behaves strange when I pass some symbols. MY SOURCE CODE import argparse from cryptography.fernet import…
Sundararajan
  • 544
  • 2
  • 9
  • 25
0
votes
2 answers

Is there any side-effect of "cryptography==2.4.2" installation because of "CryptographyDeprecationWarning: Python 2" error?

With docker-compose -f up -d have observed following error : /usr/local/lib/python2.7/dist-packages/cryptography/__init__.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now…
Pooja
  • 481
  • 1
  • 8
  • 15
0
votes
0 answers

Compressing and Decompressing Integer

Situation:- I am using Python. I am using RSA and I am using two 64 bit keys. I am not an cryptographer . I can provide you the RSA code if needed but i am not posting it as it doesn't have to do anything with the problem. I have to give the…
0
votes
1 answer

python - cryptography package - import error

I'm working in an Alpine docker container, I'm experiencing the following ImportError while starting a python shell: Traceback (most recent call last): File "manage.py", line 15, in execute_from_command_line(sys.argv) File…
Luke
  • 1,794
  • 10
  • 43
  • 70
0
votes
1 answer

How to get raw key data from DHPublicKey?

I followed instructions for generating private/public keys from DH group in https://cryptography.io/en/latest/hazmat/primitives/asymmetric/dh/ and I was able to get to this: >>>…
fituldo
  • 3
  • 2
0
votes
1 answer

raise InvalidToken, cryptography.fernet.InvalidToken

I am having issues with my program, all it is doing is encrypting and decrypting text based on a key. However when I try and decrypt the encrypted words, it just spits out the error raise InvalidToken cryptography.fernet.InvalidToken This is the…
user12624402