6

The following message is given in code:

V C Z J C Z I Z J M Z J L X Y H M J Y H E M C W S J M W Z ​​N C X W J S Y Q X W Z C O X J H M C J D V S O J H Y ​​H W W Z O H @

Write a program that proposes possible decryption of the same knowing that the original message is in LATIN and that a character has also been used for space (the J character). Additional information:

  • It is a code that uses a formula y = f (x) mod p with p a prime
  • It is important to know what we are talking about
  • The message gives information for project 2

Do some of you know how to resolve this in python?

9
  • Without knowing anything about the type of f (x) you can only go for the standard approach for monoalphabetic cyphers (distribution of letters compared to distribution of letters in the taget-language) Commented Jan 15, 2021 at 8:44
  • 3
    Since you have tried for 4 weeks, what exactly did you try? Show us your code / approaches. Commented Jan 15, 2021 at 8:45
  • 1
    Maybe you could start with taking a Latin dictionary and counting all letters in it and from that you can figure out percentage each letter appears in the dictionary (i.e. letter A is X% of all letters). Then you can count letters in this text and try to correlate. Commented Jan 15, 2021 at 8:46
  • @MrSmith42 I'm his classmate, we tried to approach it without write code, just to understand at least which was the sentence and what we find out is that the sentence partially encrypted is: "UTI TIBI SI VOLES LE_STRA SCRIPTOR ALGORITMO EST QUAM CELERRIME." so "@" is a simple ".". We can't reach the starting cryption function and without it we can't make the algorithm. If it can help you, the crypting alphabet has 29 letters. Commented Jan 15, 2021 at 8:53
  • Obviously p = 29. Commented Jan 15, 2021 at 8:57

1 Answer 1

4

If you take several consecutive letters:

S (19) -> M (13)
T (20) -> C (3)
U (21) -> V (22)
V (22) -> L (12)

and assume that p = 29, you can see that the increment between successive letters (mod 29) is 19.

Therefore: f(x) = 19*x.

Note that f(x) mod p is the method of encryption. I leave it as an exercise for the reader to determine how to decrypt.

Sign up to request clarification or add additional context in comments.

6 Comments

I'm trying to understand, now I would like to know ho to decrypt it, the only thing I discover is that the increment between the letters is 23, but i don't know how to proceed, could you give me another tip?
To decrypt you can just build a lookup table, e.g.an array or map, using the encryption method.
Yeah, the problem is that I can't understand how to reach the encryption method, i just wanna undestand how to do this.
See the first part of the answer above - look at some consecutive letters and their encrypted values.
Okay, I've now understand the encryption phase, basically what he's doing is: cryptedLetter * 19 % 29, now can u please explain me how to do the decryption phase? I would really appreciate that :D
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.