none
Secret code translator

    Question

  • Hello, I'am Renzo

    I have no experience with building apps, but now I will make a Secret code translator. Example: a = 11010 b = 11011 c = 11100 d = 11101 e = 11110 f= 11111 etc. How to make this. Already thanks for the Reactions.

    Thursday, March 23, 2017 7:15 PM

All replies

  • Hello, I'am Renzo

    I have no experience with building apps, but now I will make a Secret code translator. Example: a = 11010 b = 11011 c = 11100 d = 11101 e = 11110 f= 11111 etc. How to make this. Already thanks for the Reactions.

    Hi Renzo,

    Welcome aboard. :)

    *****

    You don't need to do that - in fact "real pros" have done a great job with encryption. Have you looked at that at all?


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Thursday, March 23, 2017 7:24 PM
  • I have no experience with building apps, but now I will make a Secret code translator. Example: a = 11010 b = 11011 c = 11100 d = 11101 e = 11110 f= 11111 etc.

    The codes that you have quoted appear to be binary numbers - a=26, b=27, etc.  So you can have a table that lists a number and a letter, and look up the table entry to convert one to the other.

    The table could be a pair of arrays, so A(I) was the encoded value for B(I), and vice versa.

    Or you could use two dictionaries:
    https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx

    But as the encoding appears to follow the same sequence as the letters, you could just use a numeric calculation to convert from the ASCII value of the letter to to your code value.  For instance, the ASCII value of 'a' is 97.
    https://msdn.microsoft.com/en-us/library/x9kb82hd(v=vs.110).aspx
    There are many other options.

    Thursday, March 23, 2017 9:13 PM

  • The codes that you have quoted appear to be binary numbers - a=26, b=27, etc.  So you can have a table that lists a number and a letter, and look up the table entry to convert one to the other.

    The table could be a pair of arrays, so A(I) was the encoded value for B(I), and vice versa.

    Or you could use two dictionaries:
    https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx

    But as the encoding appears to follow the same sequence as the letters, you could just use a numeric calculation to convert from the ASCII value of the letter to to your code value.  For instance, the ASCII value of 'a' is 97.
    https://msdn.microsoft.com/en-us/library/x9kb82hd(v=vs.110).aspx
    There are many other options.

    ...or a Dictionary(Of String, String) but for someone just starting out - although asking a high end question - that's a bit much don't you think?

    What's next ... shift left? ;-)


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Thursday, March 23, 2017 9:16 PM
  • ...or a Dictionary(Of String, String) but for someone just starting out - although asking a high end question - that's a bit much don't you think?

    Although it could be done with one, two dictionaries makes each-way conversions simpler. Secret coding is not a high-end application and is often used as a starter exercise.  See, for example:  
    https://blogs.msdn.microsoft.com/vbteam/2008/12/27/sshhh-its-a-secret-matt-gertz/

    Thursday, March 23, 2017 9:35 PM

  • Although it could be done with one, two dictionaries makes each-way conversions simpler. Secret coding is not a high-end application and is often used as a starter exercise.  See, for example:  
    https://blogs.msdn.microsoft.com/vbteam/2008/12/27/sshhh-its-a-secret-matt-gertz/

    :)

    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Thursday, March 23, 2017 9:39 PM

  • ...or a Dictionary(Of String, String) but for someone just starting out - although asking a high end question - that's a bit much don't you think?

    Although it could be done with one, two dictionaries makes each-way conversions simpler. Secret coding is not a high-end application and is often used as a starter exercise.  See, for example:  
    https://blogs.msdn.microsoft.com/vbteam/2008/12/27/sshhh-its-a-secret-matt-gertz/

    Acamar,

    That's a long thread - but mostly because of his formatting for the code.

    Still though, worth reading, so thanks again.

    *****

    Renzo,

    What I had in mind would work something like the following:

    You'd send "Bob" the message however you wanted to and on his end, he'd want to reverse (using your program, that is):

    Let me know if you're interested and we'll talk some more about it tomorrow.

    Food for thought. :)


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Thursday, March 23, 2017 11:17 PM
  • Hello, I'am Renzo

    I have no experience with building apps, but now I will make a Secret code translator. Example: a = 11010 b = 11011 c = 11100 d = 11101 e = 11110 f= 11111 etc. How to make this. Already thanks for the Reactions.

    Explain more please. Your sample shows 5 characters, only 1's and 0's. You cannot represent all uppercase, lowercase, numbers and punctuation marks with 5 characters.

    Friday, March 24, 2017 1:31 AM
  • You cannot represent all uppercase, lowercase, numbers and punctuation marks with 5 characters.

    There is no need to represent all the alphabetic and numeric characters in a message.  For many years 5-bit encoding was the standard. See:  https://en.wikipedia.org/wiki/Baudot_code#ITA2

    Friday, March 24, 2017 4:54 AM