Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- znaki = {'a':0, 'b':1, 'c':2, 'č':3, 'd':4, 'e':5, 'f':6, 'g':7, 'h':8, 'i':9, 'j':10, 'k':11, 'l':12, 'm':13, 'n':14, 'o':15, 'p':16, 'q':17, 'r':18, 's':19, 'š':20, 't':21, 'u':22, 'v':23, 'w':24, 'x':25, 'y':26, 'z':27, 'ž':28, 'A':29, 'B':30, 'C':31, 'Č':32, 'D':33, 'E':34, 'F':35, 'G':36, 'H':37, 'I':38, 'J':39, 'K':40, 'L':41, 'M':42, 'N':43, 'O':44, 'P':45, 'Q':46, 'R':47, 'S':48, 'Š':49, 'T':50, 'U':51, 'V':52, 'W':53, 'X':54, 'Y':55, 'Z':56, 'Ž':57, '.':58, ',':59, '-':60}
- #
- message = "Y-TČtNž,of-mQUWMA-FINf-mEtRrJjLIWušvzQš.X-č-gnnsIGPžkOuuzNmFf-mNYQcxatsuGGLzjNhkiEfvuLlDZtuBršb-ČrQHunpvqQgPOJ.bbaYč.vMrxgčf-mOcJQpDlGaoS,KElš-aIšpkatOšžOLZrkwuuzNmFf-m-TrzFAwBžVŠV"
- inverse = np.array( [ [58, 1, 2], [59, 1, 1], [6, 59, 58] ] )
- arr = np.zeros((3,60))
- for i in range (60):
- for j in range(3):
- arr[j][i] = znaki[ message[i*3+j] ]
- arr = np.dot(inverse, arr)
- for i in range (60):
- for j in range(3):
- arr[j][i] = int(arr[j][i])%61
- znaki = { v: k for k,v in znaki.items()}
- string = ""
- for i in range (60):
- for j in range(3):
- string += znaki[ arr[j][i] ]
- print (string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement