I made this encryption program in Python.
I don't have much experience (or any experience at all) about encryption (since I just gave my 9th grade finals), but I had this idea about an algorithm some time back which would enable the user to encrypt words following an algorithm where the program would follow this process for each letter of the entered word; pseudocode:
Let the variable x be the position of the alphabet in the list of alphabets sorted alphabetically Let the variable y be the position of the alphabet in the entered word For example, if the user enters 'abcd', the program would find x and y for a, b, c and d one by one Then, it would find the variable z = 26-x+y and z would be the position of the alphabet in the code in the list of alphabets In abcd : for a - x = 1, y = 1, so, z = 26-1+1 = 26, so coded alphabet = 26th alphabet = z Similarly, all of a,b,c and d will have coded alphabets as 'z' So, 'abcd' will be coded as 'zzzz'
Here's the Python code:
alphabets =['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] # Defining all sorts of functions def position(tofind,source): size = len(source) for i in range(0,size,1): if (source[i] == tofind): p = i + 1 break return p def encrypt(a): output =  sizea = len(a) for i in range(0,sizea,1): x = i+1 y = position(a[i],alphabets) z = 26-x+y if (z>26): z = z % 26 element = alphabets[z-1] output.append(element) return output def converttolist(text): size = len(text) l =  for i in range(0,size,1): l.append(text[i]) return l # The main program print () print ("NOTE : Please enter all the alphabets in lowercase...") print () given = str(input("Please enter the word to be coded : ")) givenlist = converttolist(given) outputlist = encrypt(givenlist) print () print ("The code for ",given," is :-") outputlistlength = len(outputlist) for i in range(0,outputlistlength,1): print (outputlist[i],end = "")
Let me know what you think about it.