473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Programming a cipher method using Python

thatos
105 100+
I would like to make a code. If I have a letter 'a' must return 'c' and 'd' must return 'f' i.e. must convert each letter of a given word into the third letter from that letter.
Aug 22 '07 #1
1 1171
bartonc
6,596 Expert 4TB
I would like to make a code. If I have a letter 'a' must return 'c' and 'd' must return 'f' i.e. must convert each letter of a given word into the third letter from that letter.
Expand|Select|Wrap|Line Numbers
  1. >>> cypher = dict(a='c', d='f')
  2. >>> "".join([cypher[key] for key in list("ad")])
  3. 'cf'
  4. >>> 
Aug 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Michael Sparks | last post by:
Hi, I suspect this is a bug with AMK's Crypto package from http://www.amk.ca/python/code/crypto , but want to check to see if I'm being dumb before posting a bug report. I'm looking at...
7
by: Piotr Turkowski | last post by:
Hi! Here you can get some notes about Vigenere Cipher: http://raphael.math.uic.edu/~jeremy/crypt/vignere.html Here's whole code of my program, function stats() is in polish, so you can omit...
134
by: evolnet.regular | last post by:
I've been utilising C for lots of small and a few medium-sized personal projects over the course of the past decade, and I've realised lately just how little progress it's made since then. I've...
11
by: John Salerno | last post by:
Similar to the Python Challenge, does anyone know of any other websites or books that have programming puzzles to solve? I found a book called "Puzzles for Hackers", but it seems like it might be a...
1
by: Sathyaish | last post by:
I have the following scenario: Algorithm: 3DES Cipher Mode: CBC Key Size: 128-bit Block Size: 64 bit IV: 0x0000000000000000 (an eight byte array of zeros) The results I get using .NET with...
1
by: beetle17 | last post by:
Plaintext: a  n i c e  d a y Key: -3 Ciphertext: X  k f Z b  a X v Cipher will accept commands from the user and perform the operations required by the commands. There are three different...
4
by: wagn31 | last post by:
i need to use a cipher but I have to used the assigned code in the ciphering i know how to do it, but i am not sure how to add my own dictionary. Here is what i have so far:
2
by: yeruvavasavi | last post by:
Algorithm 1: Write python programs to translate the following algorithm so that the computer can execute it. Algorithm for ceaser cipher. Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ<br> Cipher: ...
12
by: betabrain.honshu | last post by:
Hi Folks, for those of you who are familiar with the micropledge.com project, here is a good opportunity to spend or earn something: http://micropledge.com/projects/pysalsa20 I know that the...
2
by: rayoflight | last post by:
This is how my test program works. Server will encrypt some text and sends it over to the client. The client will then decrypts it. However I have some problem decrypting it. When I play...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.