[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

encoding and decoding randomly

snrh4x0r

11/7/2015 5:56:00 AM

There is a file which includes words from beginning of 26 letter english alphabet to end about 16000 or more Like *words.lisp* of content,

[code] (defparameter *words* '(
(a b a c a)
(a b a c a s)
(a b a c k)
.
.
.
.
(z y m o t i c)
(z y m u r g y))
[/code]
As I said the alphabet file also there is. Like, *alph.lisp* of content

[code]`(defparameter *alphabet* '(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))`
[/code]

I have been trying to write a function that finds the encoder of a given encrypted paragraph using the words file. As you can see, words are represented as atom lists and paragraphs are represented as list of lists (word lists). Alphabet is defined as atom list. Encrypted paragraph will be the argument of the function and as known the words and alphabet.[b] Encoder is a one-to-one, randomly shuffled alphabet[/b]

[code] Original Paragraph:
((A N X I O U S) ( H O M E ) ( N O I S E ))
Encrypted Paragraph:
((G P N Y A X Q) ( J A B L ) ( P A Y Q L ))

Alphabet: (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)

I try to find the encrypter

Encrypter : (G Z O C L H T J Y M E R B P A F W K Q I X U S N V D)
[/code]
I want advices what should I do? How can I start?

[code] Example input
(find-encrypter '((G P N Y A X Q) ( J A B L ) ( P A Y Q L )))
Example output:
(G Z O C L H T J Y M E R B P A F W K Q I X U S N V D)
[/code]
I have just written three to be an example but actually around 15 encoded words will be entered as input
Could you guide?