def test_encryption_decryption_symmetry(): """Tests whether encryption and decryption is symmetrical.""" for input in testinputs: try: assert decrypt(encrypt(input)) == input except Exception as e: print(e) assert False
def test_decrypt_from_CFSS(): """Tests whether decrypt() is able to decrypt the output of ConvertFrom-SecureString.""" for input in testinputs: try: psenc = runpscommand("ConvertTo-SecureString \"%s\" -AsPlainText -Force | ConvertFrom-SecureString" % input) assert decrypt(psenc) == input except Exception as e: print(e) assert False