Public bug reported:

When I try to use crypto from python3(Python 3.10.4) I get errors:

vricosti@vricosti-Z490-VISION-D:~$ python3 --version
Python 3.10.4
vricosti@vricosti-Z490-VISION-D:~$ pip3 freeze | grep crypto
crypto==1.4.1
cryptography==3.4.8
pycrypto==2.6.1


First error:
--------------
import sys
import os
from Crypto.Cipher import AES
from Crypto import Random

iv = Random.new().read( AES.block_size )

I get the exception: module 'time' has no attribute 'clock'
------------

Second error:
--------------
import sys
import os
from Crypto.Cipher import AES
from Crypto import Random

def decrypt(key, ciphered_filepath):
    with open(ciphered_filepath,"rb") as f:
        content = f.read()
        if len(content) > 16:
            iv = content[0:16]
            cyphertext = content[16:]
            cipher = AES.new(key, AES.MODE_CFB, iv)
            plaintext = cipher.decrypt(cyphertext)

decrypt('4STDs9cmUlkiujXuLkdTouoqOIfER4TE',
'/home/vricosti/testfile.jpg')

I get the exception: PY_SSIZE_T_CLEAN macro must be defined for '#'
formats

** Affects: python-crypto (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

- When I try to use crypto from python3 I get errors:
+ When I try to use crypto from python3(Python 3.10.4) I get errors:
+ 
+ vricosti@vricosti-Z490-VISION-D:~$ python3 --version
+ Python 3.10.4
+ vricosti@vricosti-Z490-VISION-D:~$ pip3 freeze | grep crypto
+ crypto==1.4.1
+ cryptography==3.4.8
+ pycrypto==2.6.1
+ 
  
  First error:
  --------------
  import sys
  import os
  from Crypto.Cipher import AES
  from Crypto import Random
  
  iv = Random.new().read( AES.block_size )
  
  I get the exception: module 'time' has no attribute 'clock'
  ------------
  
  Second error:
  --------------
  import sys
  import os
  from Crypto.Cipher import AES
  from Crypto import Random
  
  def decrypt(key, ciphered_filepath):
-     with open(ciphered_filepath,"rb") as f:
-         content = f.read()
-         if len(content) > 16:
-             iv = content[0:16]
-             cyphertext = content[16:]
-             cipher = AES.new(key, AES.MODE_CFB, iv)
-             plaintext = cipher.decrypt(cyphertext)
+     with open(ciphered_filepath,"rb") as f:
+         content = f.read()
+         if len(content) > 16:
+             iv = content[0:16]
+             cyphertext = content[16:]
+             cipher = AES.new(key, AES.MODE_CFB, iv)
+             plaintext = cipher.decrypt(cyphertext)
  
  decrypt('4STDs9cmUlkiujXuLkdTouoqOIfER4TE',
  '/home/vricosti/testfile.jpg')
  
- 
- I get the exception: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
+ I get the exception: PY_SSIZE_T_CLEAN macro must be defined for '#'
+ formats

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python-crypto in Ubuntu.
https://bugs.launchpad.net/bugs/1981796

Title:
  Python3-crypto fails

Status in python-crypto package in Ubuntu:
  New

Bug description:
  When I try to use crypto from python3(Python 3.10.4) I get errors:

  vricosti@vricosti-Z490-VISION-D:~$ python3 --version
  Python 3.10.4
  vricosti@vricosti-Z490-VISION-D:~$ pip3 freeze | grep crypto
  crypto==1.4.1
  cryptography==3.4.8
  pycrypto==2.6.1

  
  First error:
  --------------
  import sys
  import os
  from Crypto.Cipher import AES
  from Crypto import Random

  iv = Random.new().read( AES.block_size )

  I get the exception: module 'time' has no attribute 'clock'
  ------------

  Second error:
  --------------
  import sys
  import os
  from Crypto.Cipher import AES
  from Crypto import Random

  def decrypt(key, ciphered_filepath):
      with open(ciphered_filepath,"rb") as f:
          content = f.read()
          if len(content) > 16:
              iv = content[0:16]
              cyphertext = content[16:]
              cipher = AES.new(key, AES.MODE_CFB, iv)
              plaintext = cipher.decrypt(cyphertext)

  decrypt('4STDs9cmUlkiujXuLkdTouoqOIfER4TE',
  '/home/vricosti/testfile.jpg')

  I get the exception: PY_SSIZE_T_CLEAN macro must be defined for '#'
  formats

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-crypto/+bug/1981796/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to