Cody

Problem 1499. Kryptos - CIA Cypher Sculpture: Vigenere Encryption

Solution 3046753

Submitted on 3 Oct 2020 by Augusto Mazzei
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
phrase=upper('It was totally invisible Hows that possible? They used the Earths magnetic field X The information was gathered and transmitted undergruund to an unknown location X Does Langley know about this? They should Its buried out there somewhere X Who knows the exact location? Only WW This was his last message X Thirty eight degrees fifty seven minutes six point five seconds north Seventy seven degrees eight minutes forty four seconds west ID by rows'); phrase_encode=phrase(regexp(phrase,'[A-Z?]')); encoded_exp='VFPJUDEEHZWETZYVGWHKKQETGFQJNCEGGWHKK?DQMCPFQZDQMMIAGPFXHQRLGTIMVMZJANQLVKQEDAGDVFRPJUNGEUNAQZGZLECGYUXUEENJTBJLBQCRTBJDFHRRYIZETKZEMVDUFKSJHKFWHKUWQLSZFTIHHDDDUVH?DWKBFUFPWNTDFIYCUQZEREEVLDKFEZMOQQJLTTUGSYQPFEUNLAVIDXFLGGTEZ?FKZBSFDQVGOGIPUFXHHDRKFFHQNTGPUAECNUVPDJMQCLQUMUNEDFQELZZVRRGKFFVOEEXBDMVPNFQXEZLGREDNQFMPNZGLFLPMRJQYALMGNUVPDXVKPDQUMEBEDMHDAFMJGZNUPLGEWJLLAETG'; word1='KRYPTOS'; word2='ABSCISSA'; encoded= encode_vigenere(phrase_encode,word1,word2); assert(strcmp(encoded_exp,encoded))

M = 'ABCDEFGHIJLMNQUVWXZKRYPTOS' M = 2×26 char array 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'BCDEFGHIJLMNQUVWXZKRYPTOSA' M = 3×26 char array 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'BCDEFGHIJLMNQUVWXZKRYPTOSA' 'SABCDEFGHIJLMNQUVWXZKRYPTO' M = 4×26 char array 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'BCDEFGHIJLMNQUVWXZKRYPTOSA' 'SABCDEFGHIJLMNQUVWXZKRYPTO' 'CDEFGHIJLMNQUVWXZKRYPTOSAB' M = 5×26 char array 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'BCDEFGHIJLMNQUVWXZKRYPTOSA' 'SABCDEFGHIJLMNQUVWXZKRYPTO' 'CDEFGHIJLMNQUVWXZKRYPTOSAB' 'IJLMNQUVWXZKRYPTOSABCDEFGH' M = 6×26 char array 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'BCDEFGHIJLMNQUVWXZKRYPTOSA' 'SABCDEFGHIJLMNQUVWXZKRYPTO' 'CDEFGHIJLMNQUVWXZKRYPTOSAB' 'IJLMNQUVWXZKRYPTOSABCDEFGH' 'SABCDEFGHIJLMNQUVWXZKRYPTO' M = 7×26 char array 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'BCDEFGHIJLMNQUVWXZKRYPTOSA' 'SABCDEFGHIJLMNQUVWXZKRYPTO' 'CDEFGHIJLMNQUVWXZKRYPTOSAB' 'IJLMNQUVWXZKRYPTOSABCDEFGH' 'SABCDEFGHIJLMNQUVWXZKRYPTO' 'SABCDEFGHIJLMNQUVWXZKRYPTO' M = 8×26 char array 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'BCDEFGHIJLMNQUVWXZKRYPTOSA' 'SABCDEFGHIJLMNQUVWXZKRYPTO' 'CDEFGHIJLMNQUVWXZKRYPTOSAB' 'IJLMNQUVWXZKRYPTOSABCDEFGH' 'SABCDEFGHIJLMNQUVWXZKRYPTO' 'SABCDEFGHIJLMNQUVWXZKRYPTO' 'ABCDEFGHIJLMNQUVWXZKRYPTOS'

2   Pass
phrase=upper('The fox jumped over the moon'); phrase_encode=phrase(regexp(phrase,'[A-Z?]')); encoded_exp='VUIPFSBYVQMMWPIMEVPZCVK'; word1='KRYPTOS'; word2='MATLAB'; encoded= encode_vigenere(phrase_encode,word1,word2); assert(strcmp(encoded_exp,encoded))

M = 'MNQUVWXZKRYPTOSABCDEFGHIJL' M = 2×26 char array 'MNQUVWXZKRYPTOSABCDEFGHIJL' 'ABCDEFGHIJLMNQUVWXZKRYPTOS' M = 3×26 char array 'MNQUVWXZKRYPTOSABCDEFGHIJL' 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'TOSABCDEFGHIJLMNQUVWXZKRYP' M = 4×26 char array 'MNQUVWXZKRYPTOSABCDEFGHIJL' 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'TOSABCDEFGHIJLMNQUVWXZKRYP' 'LMNQUVWXZKRYPTOSABCDEFGHIJ' M = 5×26 char array 'MNQUVWXZKRYPTOSABCDEFGHIJL' 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'TOSABCDEFGHIJLMNQUVWXZKRYP' 'LMNQUVWXZKRYPTOSABCDEFGHIJ' 'ABCDEFGHIJLMNQUVWXZKRYPTOS' M = 6×26 char array 'MNQUVWXZKRYPTOSABCDEFGHIJL' 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'TOSABCDEFGHIJLMNQUVWXZKRYP' 'LMNQUVWXZKRYPTOSABCDEFGHIJ' 'ABCDEFGHIJLMNQUVWXZKRYPTOS' 'BCDEFGHIJLMNQUVWXZKRYPTOSA'

3   Pass
phrase=upper('Between the Devil and the deep blue sea'); phrase_encode=phrase(regexp(phrase,'[A-Z?]')); word1='AWEIGH'; word2='MATLAB'; encoded= encode_vigenere(phrase_encode,word1,word2); encoded_exp='SENMEDWTZNDDFIBLNNCHVTEDIBBCEZOA'; assert(strcmp(encoded_exp,encoded))

M = 'MNOPQRSTUVXYZAWEIGHBCDFJKL' M = 2×26 char array 'MNOPQRSTUVXYZAWEIGHBCDFJKL' 'AWEIGHBCDFJKLMNOPQRSTUVXYZ' M = 3×26 char array 'MNOPQRSTUVXYZAWEIGHBCDFJKL' 'AWEIGHBCDFJKLMNOPQRSTUVXYZ' 'TUVXYZAWEIGHBCDFJKLMNOPQRS' M = 4×26 char array 'MNOPQRSTUVXYZAWEIGHBCDFJKL' 'AWEIGHBCDFJKLMNOPQRSTUVXYZ' 'TUVXYZAWEIGHBCDFJKLMNOPQRS' 'LMNOPQRSTUVXYZAWEIGHBCDFJK' M = 5×26 char array 'MNOPQRSTUVXYZAWEIGHBCDFJKL' 'AWEIGHBCDFJKLMNOPQRSTUVXYZ' 'TUVXYZAWEIGHBCDFJKLMNOPQRS' 'LMNOPQRSTUVXYZAWEIGHBCDFJK' 'AWEIGHBCDFJKLMNOPQRSTUVXYZ' M = 6×26 char array 'MNOPQRSTUVXYZAWEIGHBCDFJKL' 'AWEIGHBCDFJKLMNOPQRSTUVXYZ' 'TUVXYZAWEIGHBCDFJKLMNOPQRS' 'LMNOPQRSTUVXYZAWEIGHBCDFJK' 'AWEIGHBCDFJKLMNOPQRSTUVXYZ' 'BCDFJKLMNOPQRSTUVXYZAWEIGH'

Suggested Problems

More from this Author246

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!