Bitcoin Forum

Other => Beginners & Help => Topic started by: Peanutswar on April 18, 2020, 11:31:58 AM



Title: Generate address and make it Hash.
Post by: Peanutswar on April 18, 2020, 11:31:58 AM
Good day people and especially to the newbies are getting curious how does the bitcoin address or any other altcoins address generated?. Today I made a basic concept system that is open for everybody that you try How does the address generated but first I would like you to introduce how does it work. Into the world of cryptocurrency, we need to make it secured all the time the address is generated randomly and check by the system it is already taken or not, after that, they will now generate the hash.

What is Hash/Hashing?
Hash is used to encrypting the password, emails, address or other information must be hidden or secured.
How the receiver and the sender get the key to unhash?
If both parties make some transaction they the sender already sent the key to the receiver so they can get the information easily.
What are the benefits of hashing?
Hashing is good to avoid from the hackers because the only one can open the code is the receiver and the hacker takes time to decode the hash.

Introduction to System.
1. Click generate. - the system will automatically create a random letter and number.

2. Click Encrypt. - to make it encrypted. The sender will send the encrypted message to the receiver.

3. Click Decrypt. -to make decrypted. The receiver uses the key to received and open the message.

Code:
 Random r = new Random();
        char[] codes = "abcdefghijklmnopqrstuvwzyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToArray();
        string output;
        void generateKey(int gkey)
        {
            output = null;
            for (int x = 0; x < codes.Length; x++)
            {
              output += codes[r.Next(0, codes.Length)];
            }

            t1bx.Text = output;
        }

        private void B_generate_Click(object sender, RoutedEventArgs e)
        {
            generateKey(10);
        }

        static string ComputeSha256Hash(string rawData)
        {
            // Create a SHA256  
            using (SHA256 sha256Hash = SHA256.Create())
            {
                // ComputeHash - returns byte array  
                byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(rawData));

                // Convert byte array to a string  
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < bytes.Length; i++)
                {
                    builder.Append(bytes[i].ToString("x2"));
                }
                return builder.ToString();
            }
        }

        static string ComputeSha256Hash2(string rawData)
        {
            // Create a SHA256  
            using (SHA256 sha256Hash = SHA256.Create())
            {
                // ComputeHash - returns byte array  
                byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF32.GetBytes(rawData));

                // Convert byte array to a string  
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < bytes.Length; i++)
                {
                    builder.Append(bytes[i].ToString("x2"));
                }
                return builder.ToString();
            }
        }

        private void B_hash_Click(object sender, RoutedEventArgs e)
        {
            txtbx_hash.Text = ComputeSha256Hash(output);
        }

        private void B_decrypt_Click(object sender, RoutedEventArgs e)
        {
            txtbx_dec.Text = output;
        }



Ps. This is came to my knowledge and understanding I hope I help you a lot. Here is the project file if you want to test
Click here to download the file[This will direct to google drive]. (https://drive.google.com/open?id=1bTRWeiUTyTFq1yV-sK8ekB2e4nSXGM8u)


Title: Re: Generate address and make it Hash.
Post by: CarnagexD on April 18, 2020, 01:50:51 PM
Good to see that you make a short introduction about the using of the bitcoin address and how does the sending process included because today there are a lot of newbies getting curious about the creation of the bitcoin address and this is the basic concept they made generate an address for over 30-50 characters to make an address still it depends on them how long they want to make but still it needs to be connected on the coins if this address is categorized on bitcoin or not also the hashing process this one aims to secure the process of transferring of funds or information of both party this code hashing mostly use for encrypting and not easily get the information by the hackers.


Title: Re: Generate address and make it Hash.
Post by: Wolfencloud on April 19, 2020, 06:08:56 AM
This is one of a must learn topic about security, there are a lot of people who doesn't know even the simplest meaning of those things, one thing that they didn't know is that it is one of the most important part of crypto especially it is all about the security of ones bitcoin address which we use almost everyday for making a transaction. Usually hackers find a lot of ways on bypassing any user's account but with the use of hashing, it is quite hard for them to enter ones device or account's security. Also, it is quite amusing that you've make an effort on creating a computer program on how hashing and generating a random bitcoin address works.


Title: Re: Generate address and make it Hash.
Post by: XenoFever on April 19, 2020, 12:34:59 PM
Nice post mate, Learning about hashing is really important for everyone, it is somehow related for security of your account, so for all the beginners out there like me, we should read and understand this post because it will help us.

It is great that you provide the code of the program, well for me, it is really important as an IT student because I am more attracted when I see some programs with code. I think you are also an IT, right?



Title: Re: Generate address and make it Hash.
Post by: bob123 on April 19, 2020, 01:13:56 PM
What is Hash/Hashing?
Hash is used to encrypting the password, emails, address or other information must be hidden or secured.

Hashing has nothing to do with encrypting.
That's not what hashing is for.


How the receiver and the sender get the key to unhash?
If both parties make some transaction they the sender already sent the key to the receiver so they can get the information easily.

You can not unhash. The idea behind a hash function is, that it is a one-way-function.
In a transaction, the sender does not send any key to the receiver.


What are the benefits of hashing?
Hashing is good to avoid from the hackers because the only one can open the code is the receiver and the hacker takes time to decode the hash.

Hashing itself does not protect anything from 'hackers'.
Further, you don't decode hashes.




Good job. That was a A+ quality shitpost.
All mentioned information is wrong. No merits for you, sir.


Title: Re: Generate address and make it Hash.
Post by: HCP on April 20, 2020, 01:12:13 AM
All mentioned information is wrong. No merits for you, sir.

Not only that... but the code is pretty bad as well. The "decrypt" button doesn't actually do anything meaningful in terms of "decryption"! All it does is display the value contained in the "output" global that is populated with the random "address" that is calculated when you click the "Generate" button! ::) ::)
Random r = new Random();
char[] codes = "abcdefghijklmnopqrstuvwzyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToArray();
string output;
void generateKey(int gkey)
    {
        output = null;
        for (int x = 0; x < codes.Length; x++)
            {
              output += codes[r.Next(0, codes.Length)];
            }

            t1bx.Text = output;
    }
...
    private void B_decrypt_Click(object sender, RoutedEventArgs e)
        {
            txtbx_dec.Text = output;
        }

OP, I understand that you're attempting to learn (and pass knowledge on to others), but unfortunately it would appear that your understanding of this topic is relatively poor. :(

There is no encryption/decryption when generating private keys (and deriving public keys and addresses from the private keys)... although they can be stored in an encrypted manner. Also, you make no use of a "key" at all in your "encryption"... you are simply generating a SHA256 "hash".... this is not the same as using the AES-256 cipher to encrypt data with a key that can then be decrypted with the same key.


Title: Re: Generate address and make it Hash.
Post by: Chivas Regal on April 20, 2020, 01:22:11 AM
Has anyone tried the google drive link to ensure it is a valid link?


Title: Re: Generate address and make it Hash.
Post by: HCP on April 20, 2020, 01:41:44 AM
Has anyone tried the google drive link to ensure it is a valid link?
No, but the Google Drive explorer shows that it is indeed a .zip file containing a Visual Studio project... however, the dir labelled "THIS IS THE EXE FILE" gives the appearance of attempting to encourage just running the .exe... :-\


Title: Re: Generate address and make it Hash.
Post by: bob123 on April 20, 2020, 08:01:07 AM
Has anyone tried the google drive link to ensure it is a valid link?

I did.

Given the fact that the whole information is nonsense, i was a bit suspicious about the uploaded zip file.
So i downloaded, unzipped and checked the .exe for malicious activity.

While some things might be slightly suspicious (like accessing memory of other processes) it seems like there is no obvious evidence for it being malware.


But as HCP has mentioned, the program isn't doing anything relevant. So there is literally not a single reason to download and use this.  


Title: Re: Generate address and make it Hash.
Post by: Velkro on April 20, 2020, 08:28:09 AM
Nice post mate, Learning about hashing is really important for everyone, it is somehow related for security of your account, so for all the beginners out there like me, we should read and understand this post because it will help us.
Its important but that is pretty advanced stuff for beginners. I mean it looks easy to someone who know something about computer security already. But for beginners it will look like magic.
One step at a time and you will get there, understand it all :) keep it up.


Title: Re: Generate address and make it Hash.
Post by: HCP on April 21, 2020, 03:58:19 AM
Like, I appreciate that the OP is attempting to learn... and trying to demonstrate the results of those attempts. So, full credit to them for that.

But, unfortunately, as stated above, what they have posted here is just poorly explained nonsense and of no real relevance... and is likely to be very confusing for other beginners. :(