Fully Responsive Theme
Resize your Browser to see the Effect
Parallax Effect
Scroll and Notice the Header Image

Simple substitution cipher breaker

Some months back a website offered up a small challenge, figure out a password they had encrypted. As there wasn’t enough text to do a statistical analysis (read: figure out e,s etc) I resorted to brute force. Try all of them. Twenty minutes if hacky VB got me this which got me: `

  Public Class codeBreakerFrm

    Private Sub Main()
          InitializeComponent()
    End Sub

    Private Sub GetDecodedText(integers As List( Of Integer))
        cipherText = String.Join( ",", integers.Select(Function (x) x))
        For Each letterComboSet In letterMatrix
            For Each code In integers
                decodedLetters += letterComboSet(code)
            Next
            decodedLetters += ControlChars.NewLine
        Next
    End Sub

    Private Sub getLetterList()
        For index = 1 To 26
            Dim i = index
            Dim letters As New Dictionary(Of Integer , Char )
            For Each c In "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                If i > 26 Then i = 1
                letters.Add(i, c)
                i += 1
            Next
            letterMatrix.Add(letters)
        Next
    End Sub

    Private Property letterMatrix As New List( Of Dictionary(Of Integer , Char ))
    Private Property decodedLetters As String = ""
    Private Property cipherText As String = ""

    Private Sub codeBreakerFrm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        getLetterList()
        Dim CodedStuff As New List( Of Integer) From {8, 6, 15, 2, 7, 17, 19, 2, 18}
        GetDecodedText(CodedStuff)
        TextBox1.Text = cipherText
        revealedText.Text = decodedLetters
    End Sub

End Class