parameters: (algorithm, key, ciphertext)
docstring: Decrypt symmetrically encrypted data and "re-sync" after prefix.
  
      :Parameters:
          - `algorithm`: integer symmetric cipher constant
          - `key`: string encryption/decryption key
          - `ciphertext`: string of encrypted data
  
      :Returns: string cleartext
  
      Perform block-sized CFB "resynced" operations *without* an IV. A prefix of
      one block of random data and a two octet integrity check before the actual
      ciphertext is expected. Instead of carrying on the decryption in one pass,
      decryption is restarted after the prefix (at the beginning of the "useful"
      ciphertext) using part of the prefix as an IV. This process is called a
      "resync."
      
      **Use this function when working with symmetrically encrypted data packets.**
  
      :Exceptions:
          - `PGPDecryptionFailure`: decrypted "re-sync" prefix check failed
docstring_summary: Decrypt symmetrically encrypted data and "re-sync" after prefix.
docstring_tokens: Decrypt symmetrically encrypted data and re - sync after prefix .
function: def decrypt_symmetric_resync(algorithm, key, ciphertext):
      """Decrypt symmetrically encrypted data and "re-sync" after prefix.
  
      :Parameters:
          - `algorithm`: integer symmetric cipher constant
          - `key`: string encryption/decryption key
          - `ciphertext`: string of encrypted data
  
      :Returns: string cleartext
  
      Perform block-sized CFB "resynced" operations *without* an IV. A prefix of
      one block of random data and a two octet integrity check before the actual
      ciphertext is expected. Instead of carrying on the decryption in one pass,
      decryption is restarted after the prefix (at the beginning of the "useful"
      ciphertext) using part of the prefix as an IV. This process is called a
      "resync."
      
      **Use this function when working with symmetrically encrypted data packets.**
  
      :Exceptions:
          - `PGPDecryptionFailure`: decrypted "re-sync" prefix check failed
      """
      ciphermod = _import_cipher(algorithm)
      bs = ciphermod.block_size
  
      clearprefix, cipherprefix = StringIO(), StringIO()
      cipherprefix.write(ciphertext[:bs+2])
      cipherprefix.seek(0)
      crypt_CFB(cipherprefix, clearprefix, algorithm, key, None, 'decrypt')
  
      clearprefix.seek(0)
      clear_prefix = clearprefix.read()
  
      if clear_prefix[-2:] == clear_prefix[bs-2:bs]: # "resync"
          clearstream, cipherstream = StringIO(), StringIO()
          cipherstream.write(ciphertext[bs+2:])
          cipherstream.seek(0)
          crypt_CFB(cipherstream, clearstream, algorithm, key, ciphertext[2:bs+2], 'decrypt')
  
          clearstream.seek(0)
          cleartext = clearstream.read()
          return cleartext
      else:
          raise PGPCryptoError("Re-sync check failed.")
function_tokens: def decrypt_symmetric_resync ( algorithm , key , ciphertext ) : ciphermod = _import_cipher ( algorithm ) bs = ciphermod . block_size clearprefix , cipherprefix = StringIO ( ) , StringIO ( ) cipherprefix . write ( ciphertext [ : bs + 2 ] ) cipherprefix . seek ( 0 ) crypt_CFB ( cipherprefix , clearprefix , algorithm , key , None , 'decrypt' ) clearprefix . seek ( 0 ) clear_prefix = clearprefix . read ( ) if clear_prefix [ - 2 : ] == clear_prefix [ bs - 2 : bs ] : # "resync" clearstream , cipherstream = StringIO ( ) , StringIO ( ) cipherstream . write ( ciphertext [ bs + 2 : ] ) cipherstream . seek ( 0 ) crypt_CFB ( cipherstream , clearstream , algorithm , key , ciphertext [ 2 : bs + 2 ] , 'decrypt' ) clearstream . seek ( 0 ) cleartext = clearstream . read ( ) return cleartext else : raise PGPCryptoError ( "Re-sync check failed." )