teste_della_porta.py


SUBMITTED BY: siriarah

DATE: Nov. 19, 2019, 9:30 p.m.

FORMAT: Python 3

SIZE: 447 Bytes

HITS: 617

  1. from della_porta import DellaPorta
  2. import sys
  3. versao = sys.version_info[0]
  4. if versao == 2:
  5. leitura = raw_input
  6. elif versao == 3:
  7. leitura = input
  8. txt_in = leitura('Texto a ser cifrado: ')
  9. txt_key = leitura('Chave: ')
  10. dporta = DellaPorta()
  11. txt_cifrado = dporta.encrypt(txt_in, txt_key)
  12. print('')
  13. print('Texto cifrado: {0}'.format(txt_cifrado))
  14. print(' Texto plano: {0}'.format(dporta.decrypt(txt_cifrado, txt_key)))

comments powered by Disqus