Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 84
#Mensagem: "SPORT NA SERIE A " #Bloco: "SPO RTN ASE RIE AXX" a1=matrix(3,[17,15,14]) a2=matrix(3,[17,19,13]) a3=matrix(3,[0,17,4]) a4=matrix(3,[17,11,5]) a5=matrix(3,[0,23,23]) B=a1.augment(a2).augment(a3).augment(a4).augment(a5) print('Matriz da cifra') B A=matrix(3,[3,10,20,20,9,17,9,4,17]) print('Matriz chave') A C=matrix(Integers(26),A*B) print('Matriz cifrada') C def invmul(a,n): #Função que calcula o inverso multiplicativo de um número "a", módulo "n" num=vector([1..n]) c=vector(a*num) d=vector(Integers(n),c) e=[j+1 for j in d if d[j]==1] if len(e)!=0: return e[0] else: return False
Matriz da cifra [17 17 0 17 0] [15 19 17 11 23] [14 13 4 5 23] Matriz chave [ 3 10 20] [20 9 17] [ 9 4 17] Matriz cifrada [13 7 16 1 14] [11 4 13 4 0] [ 9 8 6 22 15]