dcsimg
Results 1 to 22 of 22

Thread: Number Encryption Algorithm

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Number Encryption Algorithm

    Hi All
    I need vb.net code to encrypt numbers to have a fixed length string of 5 characters

    the following is the given data


    [CODE]
    Code:
    Number  >>>  ASCII Values of string characters
    ==============================
    3.5       >>>   (0  0  96  64  0)
    3.75      >>>   (0  0  112  64  1)
    4.4       >>>   (205  204  140  64  0)
    4.5       >>>   (0  0  144  64  1)
    4.7       >>>   (102  102  150  64  1)
    5         >>>   (0  0  160  64  0)
    5.75      >>>   (0  0  184  64  1)
    5.75      >>>   (0  0  184  64  2)
    6.05      >>>   (154  153  193  64  1)
    7         >>>   (0  0  224  64  1)
    7.2       >>>   (102  102  230  64  0)
    7.25      >>>   (0  0  232  64  1)
    7.5       >>>   (0  0  240  64  1)
    7.5       >>>   (0  0  240  64  2)
    7.75      >>>   (0  0  248  64  0)
    7.85      >>>   (51  51  251  64  1)
    8         >>>   (0  0  0  65  0)
    8.5       >>>   (0  0  8  65  0)
    8.5       >>>   (0  0  8  65  0)
    8.5       >>>   (0  0  8  65  0)
    8.6       >>>   (154  153  9  65  0)
    9         >>>   (0  0  16  65  2)
    9         >>>   (0  0  16  65  1)
    9         >>>   (0  0  16  65  2)
    9.2       >>>   (51  51  19  65  1)
    9.5       >>>   (0  0  24  65  2)
    9.5       >>>   (0  0  24  65  0)
    9.5       >>>   (0  0  24  65  1)
    9.5       >>>   (0  0  24  65  0)
    9.85      >>>   (154  153  29  65  1)
    10        >>>   (0  0  32  65  5)
    10        >>>   (0  0  32  65  1)
    10        >>>   (0  0  32  65  2)
    10        >>>   (0  0  32  65  0)
    10        >>>   (0  0  32  65  2)
    10.2      >>>   (51  51  35  65  1)
    10.25     >>>   (0  0  36  65  2)
    10.25     >>>   (0  0  36  65  2)
    10.5      >>>   (0  0  40  65  1)
    10.5      >>>   (0  0  40  65  1)
    10.5      >>>   (0  0  40  65  0)
    10.5      >>>   (0  0  40  65  1)
    10.75     >>>   (0  0  44  65  1)
    10.75     >>>   (0  0  44  65  2)
    11        >>>   (0  0  48  65  0)
    11        >>>   (0  0  48  65  0)
    11        >>>   (0  0  48  65  2)
    11.2      >>>   (51  51  51  65  1)
    11.5      >>>   (0  0  56  65  2)
    11.5      >>>   (0  0  56  65  1)
    11.5      >>>   (0  0  56  65  1)
    11.5      >>>   (0  0  56  65  2)
    11.5      >>>   (0  0  56  65  1)
    11.5      >>>   (0  0  56  65  1)
    11.5      >>>   (0  0  56  65  3)
    11.5      >>>   (0  0  56  65  1)
    12        >>>   (0  0  64  65  0)
    12        >>>   (0  0  64  65  5)
    12        >>>   (0  0  64  65  1)
    12        >>>   (0  0  64  65  2)
    12.25     >>>   (0  0  68  65  0)
    12.25     >>>   (0  0  68  65  1)
    12.3      >>>   (205  204  68  65  1)
    12.5      >>>   (0  0  72  65  2)
    13        >>>   (0  0  80  65  2)
    13        >>>   (0  0  80  65  1)
    13        >>>   (0  0  80  65  2)
    13.4      >>>   (102  102  86  65  2)
    13.5      >>>   (0  0  88  65  1)
    13.5      >>>   (0  0  88  65  1)
    13.5      >>>   (0  0  88  65  0)
    14        >>>   (0  0  96  65  1)
    14        >>>   (0  0  96  65  0)
    14        >>>   (0  0  96  65  2)
    14        >>>   (0  0  96  65  2)
    14        >>>   (0  0  96  65  1)
    14        >>>   (0  0  96  65  1)
    14        >>>   (0  0  96  65  1)
    14        >>>   (0  0  96  65  1)
    14        >>>   (0  0  96  65  2)
    14        >>>   (0  0  96  65  1)
    14        >>>   (0  0  96  65  0)
    14.25     >>>   (0  0  100  65  3)
    14.25     >>>   (0  0  100  65  1)
    14.5      >>>   (0  0  104  65  2)
    14.5      >>>   (0  0  104  65  3)
    14.5      >>>   (0  0  104  65  1)
    14.65     >>>   (102  102  106  65  2)
    15        >>>   (0  0  112  65  1)
    15        >>>   (0  0  112  65  1)
    15.5      >>>   (0  0  120  65  6)
    15.5      >>>   (0  0  120  65  2)
    15.5      >>>   (0  0  120  65  1)
    15.5      >>>   (0  0  120  65  2)
    15.75     >>>   (0  0  124  65  3)
    16        >>>   (0  0  128  65  2)
    16        >>>   (0  0  128  65  5)
    16        >>>   (0  0  128  65  1)
    16.9      >>>   (51  51  135  65  2)
    17        >>>   (0  0  136  65  2)
    17        >>>   (0  0  136  65  0)
    17.25     >>>   (0  0  138  65  1)
    17.7      >>>   (154  153  141  65  1)
    18        >>>   (0  0  144  65  3)
    18        >>>   (0  0  144  65  1)
    18.5      >>>   (0  0  148  65  1)
    18.5      >>>   (0  0  148  65  1)
    18.5      >>>   (0  0  148  65  2)
    18.5      >>>   (0  0  148  65  3)
    18.5      >>>   (0  0  148  65  2)
    18.75     >>>   (0  0  150  65  2)
    18.8      >>>   (102  102  150  65  3)
    19        >>>   (0  0  152  65  0)
    19        >>>   (0  0  152  65  1)
    19        >>>   (0  0  152  65  0)
    19        >>>   (0  0  152  65  2)
    19.02     >>>   (246  40  152  65  1)
    19.1      >>>   (205  204  152  65  1)
    19.4      >>>   (51  51  155  65  1)
    19.5      >>>   (0  0  156  65  3)
    19.6      >>>   (205  204  156  65  1)
    19.75     >>>   (0  0  158  65  3)
    19.9      >>>   (51  51  159  65  1)
    20        >>>   (0  0  160  65  5)
    20        >>>   (0  0  160  65  0)
    20        >>>   (0  0  160  65  2)
    20        >>>   (0  0  160  65  1)
    20        >>>   (0  0  160  65  2)
    20.14     >>>   (184  30  161  65  1)
    20.5      >>>   (0  0  164  65  2)
    20.5      >>>   (0  0  164  65  1)
    20.5      >>>   (0  0  164  65  2)
    20.6      >>>   (205  204  164  65  1)
    21        >>>   (0  0  168  65  2)
    21        >>>   (0  0  168  65  2)
    21        >>>   (0  0  168  65  0)
    21.2      >>>   (154  153  169  65  1)
    21.4      >>>   (51  51  171  65  1)
    21.5      >>>   (0  0  172  65  0)
    21.5      >>>   (0  0  172  65  2)
    21.5      >>>   (0  0  172  65  2)
    21.5      >>>   (0  0  172  65  6)
    21.95     >>>   (154  153  175  65  1)
    22        >>>   (0  0  176  65  2)
    22        >>>   (0  0  176  65  1)
    22.5      >>>   (0  0  180  65  1)
    22.5      >>>   (0  0  180  65  2)
    22.5      >>>   (0  0  180  65  2)
    22.6      >>>   (205  204  180  65  3)
    22.7      >>>   (154  153  181  65  1)
    22.75     >>>   (0  0  182  65  3)
    23        >>>   (0  0  184  65  2)
    23.18     >>>   (164  112  185  65  1)
    23.5      >>>   (0  0  188  65  2)
    23.6      >>>   (205  204  188  65  1)
    23.7      >>>   (154  153  189  65  1)
    23.7      >>>   (154  153  189  65  1)
    23.8      >>>   (102  102  190  65  2)
    24        >>>   (0  0  192  65  1)
    24        >>>   (0  0  192  65  3)
    24        >>>   (0  0  192  65  1)
    24.5      >>>   (0  0  196  65  3)
    24.6      >>>   (205  204  196  65  1)
    24.9      >>>   (51  51  199  65  1)
    25        >>>   (0  0  200  65  1)
    25        >>>   (0  0  200  65  2)
    25.5      >>>   (0  0  204  65  5)
    25.5      >>>   (0  0  204  65  2)
    25.6      >>>   (205  204  204  65  1)
    26        >>>   (0  0  208  65  1)
    26        >>>   (0  0  208  65  0)
    26        >>>   (0  0  208  65  2)
    Last edited by mrnooo2000; Jul 15th, 2018 at 03:07 AM.

  2. #2
    Fanatic Member
    Join Date
    Nov 2017
    Posts
    858

    Re: Number Encryption Algorithm

    Please explain in onerous detail why, in some cases, input values, such as 14 or 11.5, have multiple potential output values.

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,472

    Re: Number Encryption Algorithm

    Quote Originally Posted by mrnooo2000 View Post
    I need vb.net code to encrypt numbers to have a fixed length string of 5 characters
    Congratulations. Let us know how it goes. If you encounter a particular issue along the way, let us know and we may be able to help.

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    it is a homework
    i think the multiple values indicate that the 5th character in ignored in the encryption this what i think

  5. #5
    Fanatic Member
    Join Date
    Nov 2017
    Posts
    858

    Re: Number Encryption Algorithm

    Quote Originally Posted by mrnooo2000 View Post
    it is a homework
    i think the multiple values indicate that the 5th character in ignored in the encryption this what i think
    Sounds like fun homework. Good luck with it.

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    any idea?

  7. #7
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,472

    Re: Number Encryption Algorithm

    This site is not intended as a code-writing service. It's your homework so you need to show that you've put some thought and effort into it. If you have no idea whatsoever then you don't really deserve any marks for the assignment. I say that not to be mean but to be realistic. You should have your notes and/or text book from your class to refer to and your teacher should be your first port of call if you can't get started. When you've done all you can and encounter a specific issue that you can't get past, that would be the time to post here and you'll find plenty of people willing to help, myself included. The question, as you've presented it, seems nonsensical. It looks like all you've presented is a lookup table.

  8. #8

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    the task is a database containing data and u are asked to add new data to it
    the old data is encrypted with diferrent simple algorithms
    text data encrypted with cesar algorithm
    numbers encrypted to new characters on basis of 2^4 or 2^5 (i think)

    i just need an idea

  9. #9

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    no cheats here the task is open for search an trials
    really i do mybest but i'm lost i need a start
    Last edited by mrnooo2000; Jul 10th, 2018 at 01:08 AM.

  10. #10
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,472

    Re: Number Encryption Algorithm

    Quote Originally Posted by mrnooo2000 View Post
    numbers encrypted to new characters on basis of 2^4 or 2^5 (i think)
    How are we supposed to know if you don't? That something that you need to confirm first. That's got nothing to do with VB.NET development specifically.

    Quote Originally Posted by mrnooo2000 View Post
    no cheats here the task is open for search an trials
    Searching the web for existing information is one thing - that's to be encouraged for any developer - but posting your homework and saying "tell me how" is something else entirely.

    Anyway, I've said my bit. I'll say no more unless you show that you've made some initial progress at least.

  11. #11

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    the data i have posted is the resault of my effort
    i was not given all these data and i came to the forum after many days of hard work
    i wrore code to get numbers from the encrypted string
    i was thinking that there is a known algorithm for that
    Last edited by mrnooo2000; Jul 15th, 2018 at 02:58 AM.

  12. #12
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,472

    Re: Number Encryption Algorithm

    That's all information that should have been provided up front. There's no way that we were going to just guess all that. You need to provide a full and clear explanation of the problem. You've gone a long way to doing that now but I think there's still missing information. For instance, why did you think that that code should do as you need? Did you just pluck codepage 1256 out of thin air? Assume that we know nothing about your project (because we don't) and provide ALL the relevant information.

  13. #13
    Fanatic Member
    Join Date
    Nov 2017
    Posts
    858

    Re: Number Encryption Algorithm

    What you've posted thus far is basically meaningless to anyone who isn't in the same class as you.

    You might as well post the full wording of the actual assignment question. At this point I'm pretty much only in this thread for entertainment, and I'm assuming jmc has pretty much checked out as well, but if you post the text of the actual assignment it might pique the interest of those who can offer useful advice.

  14. #14

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    there were no information supplied except the data(encrypted string characters in a database table) and gui form to show plain data
    i converted encrypted string characters to their ascii values
    and wrote the code to convert these acsii values to the original numbers

    the goal of the exercise is to add new data to the database

  15. #15
    Frenzied Member jdc20181's Avatar
    Join Date
    Oct 2015
    Location
    Indiana
    Posts
    1,134

    Re: Number Encryption Algorithm

    Just a nice tip be sure to end your Codeblock with the corresponding [/Code]

    Also you just pasted a bunch of code and asked us to do it for you...It is homework. It means YOU need to do it, not us. Google is a good friend, he can help you solve a lot of tutorial related questions..
    Disclaimer: When code is given for example - it is merely a example.
    See my browser project BeffsBrowser
    Try my new Browser project LightBrowse "A Browser and not much else" Screen Capture with Imgur API


    Unless said otherwise (e.g. From one of my projects thus, those are mostly licensed under MIT) - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.

  16. #16
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    4,260

    Re: Number Encryption Algorithm

    Quote Originally Posted by mrnooo2000 View Post
    there were no information supplied except the data(encrypted string characters in a database table) and gui form to show plain data
    i converted encrypted string characters to their ascii values
    and wrote the code to convert these acsii values to the original numbers

    the goal of the exercise is to add new data to the database
    Ok, if the goal is to add new data to a database then let's focus on that. What type of database? What have you tried? What is the database table structure (Field names and data type). Or do you have that part working??

  17. #17

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    Quote Originally Posted by wes4dbt View Post
    Ok, if the goal is to add new data to a database then let's focus on that. What type of database? What have you tried? What is the database table structure (Field names and data type). Or do you have that part working??
    the problem is not the data addition (i can manage)
    the proplem is encrypting data with the same algorithm as old data

  18. #18

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    Quote Originally Posted by jdc20181 View Post
    Just a nice tip be sure to end your Codeblock with the corresponding [/Code]

    Also you just pasted a bunch of code and asked us to do it for you...It is homework. It means YOU need to do it, not us. Google is a good friend, he can help you solve a lot of tutorial related questions..
    ofcourse it is my homework , and i want idea about this encryption algorithm to do it myself
    i dont want any one to do it instead of me
    i search for the idea only and i googled itwith no success

  19. #19
    Frenzied Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    1,269

    Re: Number Encryption Algorithm

    Quote Originally Posted by mrnooo2000 View Post
    ofcourse it is my homework , and i want idea about this encryption algorithm to do it myself
    Being asked to crack encryption methods without any clues sounds like a very strange homework assignment to me. Anyway...

    Your unencrypted numbers are floating point numbers. Your encrypted data consists of 5 byte values.

    In .NET, the Single Data Type is one of the Data Types that is used to hold floats. It uses just 4 bytes internally.

    You can use the BitConverter.GetBytes(Single) Method to examine those 4 Byte values.

    The BitConverter.ToSingle(Byte(), Int32) Method goes the other way (produces a floating point number from 4 Byte values).

  20. #20
    Fanatic Member
    Join Date
    Nov 2017
    Posts
    858

    Re: Number Encryption Algorithm

    OP, why did you delete the code you had posted in post 11?

    It is very hard to follow what the status of your issue is. Is it the case that you've figured out how to do one way of this process but are struggling with reversing the process?

    The code you had posted and had deleted looked like you might have been on the right track, but since that is gone it is a mystery what exactly your issue is.
    Last edited by OptionBase1; Jul 15th, 2018 at 09:21 AM.

  21. #21

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    OP, why did you delete the code you had posted in post 11?
    i deleted code cause i found some errors in resualts

  22. #22

    Thread Starter
    Member
    Join Date
    Feb 2016
    Posts
    47

    Re: Number Encryption Algorithm

    Quote Originally Posted by Inferrd View Post
    Being asked to crack encryption methods without any clues sounds like a very strange homework assignment to me. Anyway...

    Your unencrypted numbers are floating point numbers. Your encrypted data consists of 5 byte values.

    In .NET, the Single Data Type is one of the Data Types that is used to hold floats. It uses just 4 bytes internally.

    You can use the BitConverter.GetBytes(Single) Method to examine those 4 Byte values.

    The BitConverter.ToSingle(Byte(), Int32) Method goes the other way (produces a floating point number from 4 Byte values).
    yes i think that is exactly what i need
    i will give it a try

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width