Python Forum
What is an Encryption And Decryption
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is an Encryption And Decryption
#7
Hm! The simplest encryption for me is just to use a bitwise xor against some key.

>>> word = 'hello world'
>>> enc = "".join([chr(ord(char) ^ ord('a')) for char in word])
>>> enc
'\t\x04\r\r\x0eA\x16\x0e\x13\r\x05'
>>> dec = "".join([chr(ord(char) ^ ord('a')) for char in enc])
>>> dec
'hello world'
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
What is an Encryption And Decryption - by Lamon112 - Jan-13-2017, 02:30 AM
RE: What is an Encryption And Decryption - by wavic - Jan-13-2017, 07:00 AM
RE: What is an Encryption And Decryption - by wavic - Jan-14-2017, 10:56 AM
RE: What is an Encryption And Decryption - by Kebap - Jan-14-2017, 10:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Decryption not working if key has same symbol like text Paragoon2 0 333 Nov-11-2023, 09:32 PM
Last Post: Paragoon2
Question Help with function - encryption - messages - NameError: name 'message' is not defined MrKnd94 4 2,957 Nov-11-2022, 09:03 PM
Last Post: deanhystad
  need help one time pad encryption implementation ! nad556 1 1,970 Nov-28-2020, 06:11 PM
Last Post: nad556
  encryption and decryption with python ibrahim 1 1,845 May-16-2020, 03:14 PM
Last Post: Larz60+
  cipher decryption tool nightfox82 0 1,352 Mar-25-2020, 06:36 AM
Last Post: nightfox82
  File encryption itzik 5 2,921 Nov-05-2019, 12:29 PM
Last Post: Gribouillis
  Vernam encryption method for files JohnCTX 1 2,463 Sep-18-2019, 04:31 PM
Last Post: JohnCTX
  Regarding encryption and decryption naressh1994 1 2,472 Jan-25-2019, 07:26 AM
Last Post: buran
  AES encryption - does not match between arduino and python 3 crypto guillaume55 0 4,052 Sep-23-2018, 11:14 AM
Last Post: guillaume55
  Python function that uses a word as the encryption key, rather than an integer wak_stephanie 4 4,889 Aug-31-2018, 12:16 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020