sun misc base64encoder

search for more blogs here

 

"Digital Signatures Explained" posted by ~Ray
Posted on 2008-03-15 23:22:46

It’s fairly easy to get digital signatures working with web services. Just pull up the docs for your web service stack and follow the directions. Some configuration here and keystores there and you’re good to go. But just what is happening under the covers? Digitally signing something might seem like magic but it’s rather simple conceptually even though it builds on some pretty heavy theory (mostly math ugh!). However in this post I’m going to communicate about the concepts and leave the math to someone else. Do these two functions seem a little desire what SSL does? You’re alter! SSL provides those features for data in transit while a digital signature does the same thing at the message aim. SSL and digital signatures don’t work in the exact same way but they do perform similar high-level functions. One interesting difference between the two is that the digital signature stays with the message even if it’s sitting in a stand or on disk somewhere (assuming that it’s not intentionally stripped at some inform). I’d like to mention one more thing about SSL and signatures before digging out of this SSL rabbit hole: You can use signatures and SSL at the same time. Why might you want to do this? There are several reasons: Creating signed data is a two go process. The first step is to hash the data and the second step is to sign the hash. Both of these steps are cryptographic operations but neither actually encrypts the data. Fortunately the Java API provides classes for doing these operations so we don’t have to write any of that complex cram. We’ll see these APIs in action in a bit. NOTE: Technically both of the previous assertions are not absolutely adjust. The time and computing power required for reversing a chop make it unlikely. The more likely case for "reversing" a hash is to leverage a pre-computed chop dictionary which I’ll address briefly later. Finally there are so called "collisions" where two different inputs can act the same hash but this situation is extremely rare). Because of these features hash algorithms are often used for storing passwords. Take the user’s password hash it and then hold on it in LDAP or a database. You can’t anticipate the password from the hash so the stored passwords are reasonably obtain from prying eyes. But when the user logs in you chop the newly supplied password and analyse it against the chop on file. If they match the user is authenticated. I bet you already knew that stuff. The cool thing is that’s the first half of generating a signature. Before we move on to the second half let’s have a look at how to generate a hash using the Java APIs. The label above leverages the MessageDigest class for hashing data. "Digest" is another evince for "hash." We express the MessageDigest disapprove that we want to use the SHA-1 algorithm and then cater it the data using the update() method. You can call that method repeatedly until all of your data is included in the hash. Then simply call digest() to get the fixed-length chop. Notice that the chop is actually a byte array which would create non-printable characters. So to show you the chop for the input data I’ll first convert the chop desire this: Before we move on to signing data. I’d like to have in mind one more thing about hashing. The one-way nature of a cryptographic hash is very useful but it can bite you. Since the same enter always generates the same chop for a given algorithm a bad guy who can get direct of your hashed data might be able to use a precomputed chop dictionary to determine your original text. It’s choose of desire a reverse-lookup of the hash. For example a hash dictionary will undergo the hashes for common passwords such as "Password" or "ABC123" and the bad guy can just ask the chop to get the corresponding input. The correct is to add some "salt" to the chop. A salt is just a bit of data that you’ll add to your input text when you reason the chop. This simply equates to another call to modify() method. Only you know the value of this salt which acts like a simple pass key or password and negates the ability for a bad guy to cause the enter data. For example the hash for "Corned beef hash" is TARd8ciquglqtzCGlhl/Ano8+kE= and always ordain be. The chop of "Corned beef chop" with a salt of "Pinch of flavor" is rEN7xxJPqyY7pkspLL902NkmJn0=. Obviously the evince "grip of Salt" would undergo to be kept secret. Conceptually we would now just sign the hash. However with the Java API the hashing is done for us as move of the signing process so we wouldn’t actually perform the steps above to create the signature. Instead we’d just use the Signature categorise. Using the Signature class is a little more involved than hashing because we need a private key to actually do the signing. The corresponding public key would be used by the recipient to affirm the signature later. Ideally you would have your keys in a keystore and use them with the Signature categorise. For demonstration purposes I’m going to generate the keypair on the fly. Yes. I’m lazy but it also makes the pertinent signing machinery stand out better. Call it artistic authorise. // create a keypair which// contains the private/public keysKeyPairGenerator keyGen = KeyPairGenerator getInstance("DSA");keyGen initialize(1024 new SecureRandom());KeyPair keyPair = keyGen generateKeyPair();// Sign some dataSignature sig = Signature getInstance("DSA");sig initSign(keyPair getPrivate());sig update("Sign on the dotted lie" getBytes());byte[] signedData = sig sign(); The first group of code generates a sample keypair that as shown here will only live until it goes out of scope. It’s good enough for our purposes though. The second group is where the action is. We tell the Signature disapprove that we be to use the DSA (Digital Signature Algorithm) and then we fill it with the private key to use as the signer. Add the text via update() just like we did for hashing and then call write(). Just like before we get back a byte array which is unprintable. After encoding the signed data. I can tell you that the signature for "write on the dotted line" looks like this: Now the results here are a little trickier than when hashing. If you run this code you’ll get a different encoded arrange than what’s shown here. It’ll be different for two reasons: To see if I REALLY said "Sign on the dotted lie" you would press together my public key the message and the signed message to see if they reorient. That’s imprecise language for the process of determining if given the message the private key associated with the public key would create the signed communicate. It’s choose of equivalent to the affect of checking passwords using a hash as described above except the keys undergo been added to the mix. As before the first line tells the Signature object which signing algorithm to use and it has to match the algorithm that was used originally to sign the message. The second lie loads the public key that matches the private key used to write the data. (Important: The recipient does NOT and should not have your private key!) We then load the message with the modify() method. Finally we pass the signed data to the affirm() method. If it returns true the signature is verified. Changing even one engrave in the message or signed data will cause verification to fail which is what you want. And obviously specifying a public key that does not match the signer’s private key will fail too. To sum up verification if the message is modified in any way verification will fail. Somebody monkeyed with the data and you were able to detect it. That’s data integrity checking. If verification fails because a mismatched public key was used then you know that someone other than who you expected signed the communicate. To my knowledge you can’t identify between the two causes of verification failure.

Forex Groups - Tips on Trading

Related article:
http://monduke.com/2007/11/25/digital-signatures-explained/

comments | Add comment | Report as Spam


"Digital Signatures Explained" posted by ~Ray
Posted on 2008-03-15 23:22:46

It’s fairly easy to get digital signatures working with web services. Just pull up the docs for your web service lade and go the directions. Some configuration here and keystores there and you’re good to go. But just what is happening under the covers? Digitally signing something might seem like magic but it’s rather simple conceptually change surface though it builds on some pretty heavy theory (mostly math ugh!). However in this affix I’m going to talk about the concepts and leave the math to someone else. Do these two functions be a little like what SSL does? You’re alter! SSL provides those features for data in transit while a digital signature does the same thing at the message level. SSL and digital signatures don’t work in the exact same way but they do perform similar high-level functions. One interesting difference between the two is that the digital signature stays with the message change surface if it’s sitting in a queue or on disk somewhere (assuming that it’s not intentionally stripped at some inform). I’d like to have in mind one more thing about SSL and signatures before digging out of this SSL rabbit hole: You can use signatures and SSL at the same time. Why might you want to do this? There are several reasons: Creating signed data is a two step affect. The first go is to hash the data and the second step is to write the hash. Both of these steps are cryptographic operations but neither actually encrypts the data. Fortunately the Java API provides classes for doing these operations so we don’t have to write any of that complex stuff. We’ll see these APIs in challenge in a bit. say: Technically both of the previous assertions are not absolutely adjust. The time and computing power required for reversing a hash make it unlikely. The more likely case for "reversing" a hash is to leverage a pre-computed hash dictionary which I’ll discuss briefly later. Finally there are so called "collisions" where two different inputs can create the same hash but this situation is extremely rare). Because of these features chop algorithms are often used for storing passwords. Take the user’s password hash it and then hold on it in LDAP or a database. You can’t guess the password from the hash so the stored passwords are reasonably obtain from prying eyes. But when the user logs in you hash the newly supplied password and analyse it against the chop on file. If they match the user is authenticated. I bet you already knew that cram. The cool thing is that’s the first half of generating a signature. Before we act on to the back up half let’s undergo a be at how to generate a hash using the Java APIs. The label above leverages the MessageDigest categorise for hashing data. "Digest" is another word for "chop." We express the MessageDigest object that we want to use the SHA-1 algorithm and then feed it the data using the update() method. You can call that method repeatedly until all of your data is included in the hash. Then simply call digest() to get the fixed-length chop. Notice that the chop is actually a byte array which would create non-printable characters. So to show you the hash for the input data I’ll first encode the hash like this: Before we act on to signing data. I’d like to mention one more thing about hashing. The one-way nature of a cryptographic chop is very useful but it can bite you. Since the same input always generates the same hash for a given algorithm a bad guy who can get hold of your hashed data might be able to use a precomputed chop dictionary to determine your original text. It’s sort of like a reverse-lookup of the hash. For example a hash dictionary will have the hashes for common passwords such as "Password" or "ABC123" and the bad guy can just ask the chop to get the corresponding input. The correct is to add some "flavor" to the chop. A salt is just a bit of data that you’ll add to your enter text when you compute the hash. This simply equates to another call to update() method. Only you know the value of this salt which acts desire a simple pass key or password and negates the ability for a bad guy to determine the input data. For example the hash for "Corned complain hash" is TARd8ciquglqtzCGlhl/Ano8+kE= and always ordain be. The chop of "Corned complain hash" with a flavor of "Pinch of Salt" is rEN7xxJPqyY7pkspLL902NkmJn0=. Obviously the phrase "Pinch of Salt" would have to be kept secret. Conceptually we would now just sign the hash. However with the Java API the hashing is done for us as move of the signing process so we wouldn’t actually perform the steps above to generate the signature. Instead we’d just use the Signature categorise. Using the Signature categorise is a little more involved than hashing because we need a private key to actually do the signing. The corresponding public key would be used by the recipient to affirm the signature later. Ideally you would have your keys in a keystore and use them with the Signature class. For demonstration purposes I’m going to create the keypair on the fly. Yes. I’m lazy but it also makes the pertinent signing machinery stand out better. Call it artistic authorise. // Generate a keypair which// contains the private/public keysKeyPairGenerator keyGen = KeyPairGenerator getInstance("DSA");keyGen initialize(1024 new SecureRandom());KeyPair keyPair = keyGen generateKeyPair();// write some dataSignature sig = Signature getInstance("DSA");sig initSign(keyPair getPrivate());sig modify("Sign on the dotted lie" getBytes());byte[] signedData = sig write(); The first group of code generates a sample keypair that as shown here will only live until it goes out of scope. It’s good enough for our purposes though. The back up group is where the challenge is. We tell the Signature disapprove that we want to use the DSA (Digital Signature Algorithm) and then we load it with the private key to use as the signer. Add the text via update() just like we did for hashing and then call sign(). Just like before we get approve a byte array which is unprintable. After encoding the signed data. I can express you that the signature for "write on the dotted line" looks like this: Now the results here are a little trickier than when hashing. If you run this label you’ll get a different encoded arrange than what’s shown here. It’ll be different for two reasons: To see if I REALLY said "Sign on the dotted line" you would mash together my public key the message and the signed message to see if they reorient. That’s imprecise language for the affect of determining if given the message the private key associated with the public key would produce the signed message. It’s sort of equivalent to the affect of checking passwords using a chop as described above object the keys have been added to the mix. As before the first lie tells the Signature object which signing algorithm to use and it has to be the algorithm that was used originally to write the communicate. The back up line loads the public key that matches the private key used to sign the data. (Important: The recipient does NOT and should not undergo your private key!) We then load the communicate with the modify() method. Finally we pass the signed data to the verify() method. If it returns adjust the signature is verified. Changing change surface one character in the message or signed data will create verification to fail which is what you want. And obviously specifying a public key that does not be the signer’s private key will disappoint too. To sum up verification if the message is modified in any way verification ordain fail. Somebody monkeyed with the data and you were able to sight it. That’s data integrity checking. If verification fails because a mismatched public key was used then you know that someone other than who you expected signed the communicate. To my knowledge you can’t identify between the two causes of verification failure.

Forex Groups - Tips on Trading

Related article:
http://monduke.com/2007/11/25/digital-signatures-explained/

comments | Add comment | Report as Spam


"Digital Signatures Explained" posted by ~Ray
Posted on 2008-03-15 23:22:46

It’s fairly easy to get digital signatures working with web services. Just pull up the docs for your web service stack and follow the directions. Some configuration here and keystores there and you’re good to go. But just what is happening under the covers? Digitally signing something might be desire magic but it’s rather simple conceptually even though it builds on some pretty heavy theory (mostly math ugh!). However in this post I’m going to talk about the concepts and leave the math to someone else. Do these two functions seem a little desire what SSL does? You’re alter! SSL provides those features for data in go across while a digital signature does the same thing at the message level. SSL and digital signatures don’t work in the exact same way but they do act similar high-level functions. One interesting difference between the two is that the digital signature stays with the message even if it’s sitting in a queue or on plough somewhere (assuming that it’s not intentionally stripped at some inform). I’d like to mention one more thing about SSL and signatures before digging out of this SSL rabbit hit: You can use signatures and SSL at the same time. Why might you want to do this? There are several reasons: Creating signed data is a two step process. The first step is to hash the data and the second step is to sign the hash. Both of these steps are cryptographic operations but neither actually encrypts the data. Fortunately the Java API provides classes for doing these operations so we don’t have to write any of that complex stuff. We’ll see these APIs in challenge in a bit. say: Technically both of the previous assertions are not absolutely true. The measure and computing power required for reversing a hash make it unlikely. The more likely case for "reversing" a chop is to leverage a pre-computed hash dictionary which I’ll discuss briefly later. Finally there are so called "collisions" where two different inputs can create the same hash but this situation is extremely rare). Because of these features hash algorithms are often used for storing passwords. Take the user’s password hash it and then store it in LDAP or a database. You can’t guess the password from the hash so the stored passwords are reasonably secure from prying eyes. But when the user logs in you chop the newly supplied password and analyse it against the hash on register. If they match the user is authenticated. I bet you already knew that stuff. The cool thing is that’s the first half of generating a signature. Before we move on to the second half let’s undergo a look at how to create a chop using the Java APIs. The code above leverages the MessageDigest class for hashing data. "Digest" is another word for "hash." We tell the MessageDigest object that we want to use the SHA-1 algorithm and then cater it the data using the update() method. You can call that method repeatedly until all of your data is included in the hash. Then simply label digest() to get the fixed-length hash. sight that the hash is actually a byte array which would create non-printable characters. So to show you the hash for the input data I’ll first encode the hash desire this: Before we move on to signing data. I’d like to mention one more thing about hashing. The one-way nature of a cryptographic chop is very useful but it can bite you. Since the same input always generates the same hash for a given algorithm a bad guy who can get hold of your hashed data might be able to use a precomputed chop dictionary to determine your original text. It’s sort of desire a reverse-lookup of the chop. For example a hash dictionary ordain have the hashes for common passwords such as "Password" or "ABC123" and the bad guy can just query the hash to get the corresponding input. The remedy is to add some "salt" to the hash. A salt is just a bit of data that you’ll add to your input text when you compute the chop. This simply equates to another call to update() method. Only you experience the value of this flavor which acts desire a simple pass key or password and negates the ability for a bad guy to determine the input data. For example the hash for "Corned beef chop" is TARd8ciquglqtzCGlhl/Ano8+kE= and always ordain be. The hash of "Corned beef chop" with a salt of "Pinch of Salt" is rEN7xxJPqyY7pkspLL902NkmJn0=. Obviously the phrase "Pinch of Salt" would have to be kept secret. Conceptually we would now just sign the chop. However with the Java API the hashing is done for us as part of the signing process so we wouldn’t actually act the steps above to create the signature. Instead we’d just use the Signature class. Using the Signature class is a little more involved than hashing because we need a private key to actually do the signing. The corresponding public key would be used by the recipient to verify the signature later. Ideally you would have your keys in a keystore and use them with the Signature class. For demonstration purposes I’m going to create the keypair on the fly. Yes. I’m lazy but it also makes the pertinent signing machinery rest out exceed. Call it artistic license. // Generate a keypair which// contains the private/public keysKeyPairGenerator keyGen = KeyPairGenerator getInstance("DSA");keyGen initialize(1024 new SecureRandom());KeyPair keyPair = keyGen generateKeyPair();// Sign some dataSignature sig = Signature getInstance("DSA");sig initSign(keyPair getPrivate());sig update("Sign on the dotted line" getBytes());byte[] signedData = sig write(); The first group of label generates a sample keypair that as shown here will only live until it goes out of scope. It’s good enough for our purposes though. The second group is where the action is. We tell the Signature object that we want to use the DSA (Digital Signature Algorithm) and then we load it with the private key to use as the signer. Add the text via update() just like we did for hashing and then call sign(). Just like before we get back a byte array which is unprintable. After encoding the signed data. I can tell you that the signature for "Sign on the dotted line" looks like this: Now the results here are a little trickier than when hashing. If you run this code you’ll get a different encoded string than what’s shown here. It’ll be different for two reasons: To see if I REALLY said "Sign on the dotted lie" you would mash together my public key the communicate and the signed communicate to see if they align. That’s imprecise language for the process of determining if given the message the private key associated with the public key would produce the signed communicate. It’s sort of equivalent to the process of checking passwords using a hash as described above except the keys have been added to the mix. As before the first line tells the Signature object which signing algorithm to use and it has to match the algorithm that was used originally to write the message. The second lie loads the public key that matches the private key used to write the data. (Important: The recipient does NOT and should not have your private key!) We then fill the communicate with the update() method. Finally we go the signed data to the verify() method. If it returns true the signature is verified. Changing even one character in the communicate or signed data will cause verification to disappoint which is what you be. And obviously specifying a public key that does not match the signer’s private key will fail too. To sum up verification if the message is modified in any way verification will disappoint. Somebody monkeyed with the data and you were able to sight it. That’s data integrity checking. If verification fails because a mismatched public key was used then you know that someone other than who you expected signed the message. To my knowledge you can’t distinguish between the two causes of verification failure.

Forex Groups - Tips on Trading

Related article:
http://monduke.com/2007/11/25/digital-signatures-explained/

comments | Add comment | Report as Spam


"Digital Signatures Explained" posted by ~Ray
Posted on 2008-03-15 23:22:46

It’s fairly easy to get digital signatures working with web services. Just pull up the docs for your web service stack and follow the directions. Some configuration here and keystores there and you’re good to go. But just what is happening under the covers? Digitally signing something might be like magic but it’s rather simple conceptually even though it builds on some pretty heavy theory (mostly math ugh!). However in this post I’m going to talk about the concepts and leave the math to someone else. Do these two functions be a little like what SSL does? You’re alter! SSL provides those features for data in transit while a digital signature does the same thing at the message level. SSL and digital signatures don’t bring home the bacon in the exact same way but they do perform similar high-level functions. One interesting difference between the two is that the digital signature stays with the message even if it’s sitting in a queue or on plough somewhere (assuming that it’s not intentionally stripped at some point). I’d like to have in mind one more thing about SSL and signatures before digging out of this SSL rabbit hole: You can use signatures and SSL at the same time. Why might you be to do this? There are several reasons: Creating signed data is a two step process. The first step is to hash the data and the back up go is to write the hash. Both of these steps are cryptographic operations but neither actually encrypts the data. Fortunately the Java API provides classes for doing these operations so we don’t have to create verbally any of that complex cram. We’ll see these APIs in action in a bit. NOTE: Technically both of the previous assertions are not absolutely adjust. The time and computing power required for reversing a hash make it unlikely. The more likely inspect for "reversing" a chop is to supplement a pre-computed hash dictionary which I’ll discuss briefly later. Finally there are so called "collisions" where two different inputs can create the same hash but this situation is extremely rare). Because of these features hash algorithms are often used for storing passwords. act the user’s password hash it and then store it in LDAP or a database. You can’t anticipate the password from the hash so the stored passwords are reasonably secure from prying eyes. But when the user logs in you hash the newly supplied password and compare it against the hash on register. If they match the user is authenticated. I bet you already knew that cram. The alter thing is that’s the first half of generating a signature. Before we move on to the second half let’s have a be at how to create a chop using the Java APIs. The code above leverages the MessageDigest class for hashing data. "Digest" is another word for "hash." We tell the MessageDigest object that we want to use the SHA-1 algorithm and then cater it the data using the update() method. You can call that method repeatedly until all of your data is included in the chop. Then simply call process() to get the fixed-length hash. sight that the hash is actually a byte array which would act non-printable characters. So to show you the chop for the enter data I’ll first encode the hash like this: Before we act on to signing data. I’d like to mention one more thing about hashing. The one-way nature of a cryptographic chop is very useful but it can grip you. Since the same enter always generates the same hash for a given algorithm a bad guy who can get hold of your hashed data might be able to use a precomputed hash dictionary to determine your original text. It’s choose of desire a reverse-lookup of the hash. For example a chop dictionary will have the hashes for common passwords such as "Password" or "ABC123" and the bad guy can just query the chop to get the corresponding input. The remedy is to add some "salt" to the chop. A salt is just a bit of data that you’ll add to your enter text when you compute the chop. This simply equates to another label to modify() method. Only you experience the determine of this flavor which acts like a simple pass key or password and negates the ability for a bad guy to determine the input data. For example the hash for "Corned beef hash" is TARd8ciquglqtzCGlhl/Ano8+kE= and always ordain be. The hash of "Corned beef chop" with a salt of "grip of Salt" is rEN7xxJPqyY7pkspLL902NkmJn0=. Obviously the phrase "Pinch of Salt" would undergo to be kept secret. Conceptually we would now just write the hash. However with the Java API the hashing is done for us as part of the signing process so we wouldn’t actually perform the steps above to generate the signature. Instead we’d just use the Signature class. Using the Signature class is a little more involved than hashing because we need a private key to actually do the signing. The corresponding public key would be used by the recipient to verify the signature later. Ideally you would undergo your keys in a keystore and use them with the Signature class. For demonstration purposes I’m going to generate the keypair on the fly. Yes. I’m lazy but it also makes the pertinent signing machinery stand out better. Call it artistic license. // create a keypair which// contains the private/public keysKeyPairGenerator keyGen = KeyPairGenerator getInstance("DSA");keyGen initialize(1024 new SecureRandom());KeyPair keyPair = keyGen generateKeyPair();// Sign some dataSignature sig = Signature getInstance("DSA");sig initSign(keyPair getPrivate());sig update("Sign on the dotted lie" getBytes());byte[] signedData = sig sign(); The first group of code generates a sample keypair that as shown here will only be until it goes out of scope. It’s good enough for our purposes though. The back up group is where the action is. We tell the Signature object that we want to use the DSA (Digital Signature Algorithm) and then we fill it with the private key to use as the signer. Add the text via update() just like we did for hashing and then call sign(). Just like before we get back a byte array which is unprintable. After encoding the signed data. I can tell you that the signature for "Sign on the dotted line" looks desire this: Now the results here are a little trickier than when hashing. If you run this code you’ll get a different encoded string than what’s shown here. It’ll be different for two reasons: To see if I REALLY said "Sign on the dotted line" you would press together my public key the communicate and the signed communicate to see if they align. That’s imprecise language for the process of determining if given the message the private key associated with the public key would produce the signed communicate. It’s sort of equivalent to the process of checking passwords using a chop as described above except the keys have been added to the mix. As before the first line tells the Signature object which signing algorithm to use and it has to match the algorithm that was used originally to write the message. The back up line loads the public key that matches the private key used to sign the data. (Important: The recipient does NOT and should not have your private key!) We then fill the message with the modify() method. Finally we pass the signed data to the verify() method. If it returns true the signature is verified. Changing change surface one character in the message or signed data will cause verification to fail which is what you want. And obviously specifying a public key that does not be the signer’s private key will disappoint too. To sum up verification if the message is modified in any way verification will disappoint. Somebody monkeyed with the data and you were able to detect it. That’s data integrity checking. If verification fails because a mismatched public key was used then you know that someone other than who you expected signed the communicate. To my knowledge you can’t distinguish between the two causes of verification failure.

Forex Groups - Tips on Trading

Related article:
http://monduke.com/2007/11/25/digital-signatures-explained/

comments | Add comment | Report as Spam


"Digital Signatures Explained" posted by ~Ray
Posted on 2008-03-15 23:22:46

It’s fairly easy to get digital signatures working with web services. Just pull up the docs for your web service stack and go the directions. Some configuration here and keystores there and you’re good to go. But just what is happening under the covers? Digitally signing something might seem like magic but it’s rather simple conceptually change surface though it builds on some pretty heavy theory (mostly math ugh!). However in this post I’m going to communicate about the concepts and get the math to someone else. Do these two functions seem a little like what SSL does? You’re alter! SSL provides those features for data in transit while a digital signature does the same thing at the communicate aim. SSL and digital signatures don’t bring home the bacon in the exact same way but they do act similar high-level functions. One interesting difference between the two is that the digital signature stays with the message even if it’s sitting in a queue or on plough somewhere (assuming that it’s not intentionally stripped at some point). I’d like to mention one more thing about SSL and signatures before digging out of this SSL hunt hit: You can use signatures and SSL at the same time. Why might you be to do this? There are several reasons: Creating signed data is a two step process. The first step is to chop the data and the back up step is to sign the hash. Both of these steps are cryptographic operations but neither actually encrypts the data. Fortunately the Java API provides classes for doing these operations so we don’t undergo to create verbally any of that complex stuff. We’ll see these APIs in challenge in a bit. NOTE: Technically both of the previous assertions are not absolutely true. The time and computing power required for reversing a chop make it unlikely. The more likely inspect for "reversing" a chop is to leverage a pre-computed hash dictionary which I’ll address briefly later. Finally there are so called "collisions" where two different inputs can create the same hash but this situation is extremely rare). Because of these features chop algorithms are often used for storing passwords. Take the user’s password hash it and then hold on it in LDAP or a database. You can’t anticipate the password from the hash so the stored passwords are reasonably secure from prying eyes. But when the user logs in you hash the newly supplied password and compare it against the hash on file. If they match the user is authenticated. I bet you already knew that stuff. The cool thing is that’s the first half of generating a signature. Before we move on to the second half let’s have a look at how to create a hash using the Java APIs. The code above leverages the MessageDigest class for hashing data. "Digest" is another word for "hash." We tell the MessageDigest disapprove that we want to use the SHA-1 algorithm and then feed it the data using the modify() method. You can label that method repeatedly until all of your data is included in the hash. Then simply call digest() to get the fixed-length chop. sight that the hash is actually a byte array which would create non-printable characters. So to show you the hash for the input data I’ll first encode the hash like this: Before we move on to signing data. I’d desire to mention one more thing about hashing. The one-way nature of a cryptographic hash is very useful but it can bite you. Since the same input always generates the same chop for a given algorithm a bad guy who can get hold of your hashed data might be able to use a precomputed hash dictionary to determine your original text. It’s sort of like a reverse-lookup of the hash. For example a chop dictionary ordain undergo the hashes for common passwords such as "Password" or "ABC123" and the bad guy can just ask the hash to get the corresponding input. The remedy is to add some "salt" to the chop. A salt is just a bit of data that you’ll add to your input text when you compute the hash. This simply equates to another call to modify() method. Only you know the value of this flavor which acts like a simple go key or password and negates the ability for a bad guy to determine the input data. For example the hash for "Corned beef hash" is TARd8ciquglqtzCGlhl/Ano8+kE= and always ordain be. The hash of "Corned beef chop" with a salt of "grip of Salt" is rEN7xxJPqyY7pkspLL902NkmJn0=. Obviously the evince "Pinch of Salt" would undergo to be kept secret. Conceptually we would now just sign the hash. However with the Java API the hashing is done for us as move of the signing affect so we wouldn’t actually perform the steps above to generate the signature. Instead we’d just use the Signature class. Using the Signature class is a little more involved than hashing because we need a private key to actually do the signing. The corresponding public key would be used by the recipient to verify the signature later. Ideally you would undergo your keys in a keystore and use them with the Signature class. For demonstration purposes I’m going to generate the keypair on the fly. Yes. I’m lazy but it also makes the pertinent signing machinery rest out better. Call it artistic license. // Generate a keypair which// contains the private/public keysKeyPairGenerator keyGen = KeyPairGenerator getInstance("DSA");keyGen initialize(1024 new SecureRandom());KeyPair keyPair = keyGen generateKeyPair();// write some dataSignature sig = Signature getInstance("DSA");sig initSign(keyPair getPrivate());sig update("Sign on the dotted lie" getBytes());byte[] signedData = sig sign(); The first group of label generates a sample keypair that as shown here will only live until it goes out of scope. It’s good enough for our purposes though. The back up group is where the action is. We express the Signature disapprove that we be to use the DSA (Digital Signature Algorithm) and then we fill it with the private key to use as the signer. Add the text via update() just like we did for hashing and then call sign(). Just like before we get back a byte arrange which is unprintable. After encoding the signed data. I can tell you that the signature for "Sign on the dotted lie" looks desire this: Now the results here are a little trickier than when hashing. If you run this code you’ll get a different encoded string than what’s shown here. It’ll be different for two reasons: To see if I REALLY said "write on the dotted line" you would mash together my public key the communicate and the signed message to see if they align. That’s imprecise language for the process of determining if given the message the private key associated with the public key would create the signed message. It’s sort of equivalent to the process of checking passwords using a hash as described above except the keys undergo been added to the mix. As before the first line tells the Signature object which signing algorithm to use and it has to match the algorithm that was used originally to sign the communicate. The second lie loads the public key that matches the private key used to sign the data. (Important: The recipient does NOT and should not undergo your private key!) We then load the message with the update() method. Finally we pass the signed data to the affirm() method. If it returns adjust the signature is verified. Changing even one character in the communicate or signed data will cause verification to fail which is what you be. And obviously specifying a public key that does not match the signer’s private key will disappoint too. To sum up verification if the communicate is modified in any way verification will fail. Somebody monkeyed with the data and you were able to sight it. That’s data integrity checking. If verification fails because a mismatched public key was used then you know that someone other than who you expected signed the message. To my knowledge you can’t identify between the two causes of verification failure.

Forex Groups - Tips on Trading

Related article:
http://monduke.com/2007/11/25/digital-signatures-explained/

comments | Add comment | Report as Spam


"Digital Signatures Explained" posted by ~Ray
Posted on 2008-03-15 23:22:45

It’s fairly easy to get digital signatures working with web services. Just pull up the docs for your web service lade and follow the directions. Some configuration here and keystores there and you’re good to go. But just what is happening under the covers? Digitally signing something might seem desire magic but it’s rather simple conceptually even though it builds on some pretty heavy theory (mostly math ugh!). However in this affix I’m going to talk about the concepts and leave the math to someone else. Do these two functions seem a little like what SSL does? You’re right! SSL provides those features for data in transit while a digital signature does the same thing at the communicate level. SSL and digital signatures don’t bring home the bacon in the exact same way but they do perform similar high-level functions. One interesting difference between the two is that the digital signature stays with the message even if it’s sitting in a queue or on disk somewhere (assuming that it’s not intentionally stripped at some inform). I’d desire to mention one more thing about SSL and signatures before digging out of this SSL rabbit hole: You can use signatures and SSL at the same measure. Why might you want to do this? There are several reasons: Creating signed data is a two step process. The first step is to chop the data and the second step is to sign the hash. Both of these steps are cryptographic operations but neither actually encrypts the data. Fortunately the Java API provides classes for doing these operations so we don’t have to write any of that complex stuff. We’ll see these APIs in action in a bit. NOTE: Technically both of the previous assertions are not absolutely adjust. The time and computing power required for reversing a chop make it unlikely. The more likely case for "reversing" a hash is to leverage a pre-computed hash dictionary which I’ll discuss briefly later. Finally there are so called "collisions" where two different inputs can act the same hash but this situation is extremely rare). Because of these features hash algorithms are often used for storing passwords. Take the user’s password hash it and then store it in LDAP or a database. You can’t anticipate the password from the chop so the stored passwords are reasonably secure from prying eyes. But when the user logs in you hash the newly supplied password and compare it against the chop on file. If they match the user is authenticated. I bet you already knew that stuff. The alter thing is that’s the first half of generating a signature. Before we move on to the second half let’s have a look at how to create a hash using the Java APIs. The code above leverages the MessageDigest class for hashing data. "process" is another word for "hash." We express the MessageDigest object that we want to use the SHA-1 algorithm and then feed it the data using the update() method. You can call that method repeatedly until all of your data is included in the hash. Then simply call digest() to get the fixed-length chop. sight that the hash is actually a byte arrange which would act non-printable characters. So to show you the chop for the enter data I’ll first encode the chop desire this: Before we move on to signing data. I’d like to mention one more thing about hashing. The one-way nature of a cryptographic hash is very useful but it can grip you. Since the same enter always generates the same hash for a given algorithm a bad guy who can get hold of your hashed data might be able to use a precomputed chop dictionary to determine your original text. It’s sort of like a reverse-lookup of the hash. For example a hash dictionary ordain have the hashes for common passwords such as "Password" or "ABC123" and the bad guy can just query the hash to get the corresponding input. The remedy is to add some "salt" to the hash. A salt is just a bit of data that you’ll add to your input text when you reason the hash. This simply equates to another call to update() method. Only you know the value of this salt which acts like a simple pass key or password and negates the ability for a bad guy to determine the enter data. For example the hash for "Corned complain hash" is TARd8ciquglqtzCGlhl/Ano8+kE= and always will be. The hash of "Corned beef chop" with a salt of "Pinch of Salt" is rEN7xxJPqyY7pkspLL902NkmJn0=. Obviously the phrase "Pinch of flavor" would have to be kept secret. Conceptually we would now just sign the chop. However with the Java API the hashing is done for us as part of the signing process so we wouldn’t actually perform the steps above to generate the signature. Instead we’d just use the Signature categorise. Using the Signature categorise is a little more involved than hashing because we need a private key to actually do the signing. The corresponding public key would be used by the recipient to affirm the signature later. Ideally you would have your keys in a keystore and use them with the Signature class. For demonstration purposes I’m going to create the keypair on the fly. Yes. I’m lazy but it also makes the pertinent signing machinery rest out better. Call it artistic license. // Generate a keypair which// contains the private/public keysKeyPairGenerator keyGen = KeyPairGenerator getInstance("DSA");keyGen determine(1024 new SecureRandom());KeyPair keyPair = keyGen generateKeyPair();// write some dataSignature sig = Signature getInstance("DSA");sig initSign(keyPair getPrivate());sig update("Sign on the dotted line" getBytes());byte[] signedData = sig sign(); The first group of label generates a sample keypair that as shown here will only live until it goes out of scope. It’s good enough for our purposes though. The second group is where the action is. We express the Signature object that we want to use the DSA (Digital Signature Algorithm) and then we load it with the private key to use as the signer. Add the text via update() just desire we did for hashing and then call write(). Just like before we get back a byte arrange which is unprintable. After encoding the signed data. I can tell you that the signature for "write on the dotted line" looks like this: Now the results here are a little trickier than when hashing. If you run this code you’ll get a different encoded string than what’s shown here. It’ll be different for two reasons: To see if I REALLY said "Sign on the dotted line" you would mash together my public key the communicate and the signed message to see if they align. That’s imprecise language for the affect of determining if given the message the private key associated with the public key would produce the signed communicate. It’s sort of equivalent to the process of checking passwords using a hash as described above object the keys undergo been added to the mix. As before the first line tells the Signature object which signing algorithm to use and it has to match the algorithm that was used originally to sign the message. The second lie loads the public key that matches the private key used to write the data. (Important: The recipient does NOT and should not have your private key!) We then load the communicate with the update() method. Finally we go the signed data to the affirm() method. If it returns true the signature is verified. Changing even one character in the message or signed data ordain create verification to fail which is what you be. And obviously specifying a public key that does not match the signer’s private key ordain fail too. To sum up verification if the message is modified in any way verification ordain fail. Somebody monkeyed with the data and you were able to detect it. That’s data integrity checking. If verification fails because a mismatched public key was used then you know that someone other than who you expected signed the communicate. To my knowledge you can’t identify between the two causes of verification failure.

Forex Groups - Tips on Trading

Related article:
http://monduke.com/2007/11/25/digital-signatures-explained/

comments | Add comment | Report as Spam


"Digital Signatures Explained" posted by ~Ray
Posted on 2008-03-15 23:22:43

It’s fairly easy to get digital signatures working with web services. Just displace up the docs for your web service stack and go the directions. Some configuration here and keystores there and you’re good to go. But just what is happening under the covers? Digitally signing something might seem desire magic but it’s rather simple conceptually even though it builds on some pretty heavy theory (mostly math ugh!). However in this post I’m going to talk about the concepts and leave the math to someone else. Do these two functions be a little like what SSL does? You’re right! SSL provides those features for data in go across while a digital signature does the same thing at the communicate level. SSL and digital signatures don’t work in the exact same way but they do perform similar high-level functions. One interesting difference between the two is that the digital signature stays with the message even if it’s sitting in a queue or on disk somewhere (assuming that it’s not intentionally stripped at some inform). I’d like to mention one more thing about SSL and signatures before digging out of this SSL hunt hole: You can use signatures and SSL at the same time. Why might you be to do this? There are several reasons: Creating signed data is a two step affect. The first step is to hash the data and the second go is to sign the hash. Both of these steps are cryptographic operations but neither actually encrypts the data. Fortunately the Java API provides classes for doing these operations so we don’t have to write any of that complex stuff. We’ll see these APIs in challenge in a bit. NOTE: Technically both of the previous assertions are not absolutely true. The time and computing power required for reversing a hash make it unlikely. The more likely case for "reversing" a hash is to leverage a pre-computed chop dictionary which I’ll discuss briefly later. Finally there are so called "collisions" where two different inputs can create the same chop but this situation is extremely rare). Because of these features chop algorithms are often used for storing passwords. Take the user’s password hash it and then store it in LDAP or a database. You can’t guess the password from the hash so the stored passwords are reasonably secure from prying eyes. But when the user logs in you hash the newly supplied password and compare it against the hash on file. If they match the user is authenticated. I bet you already knew that stuff. The cool thing is that’s the first half of generating a signature. Before we move on to the second half let’s have a look at how to generate a hash using the Java APIs. The code above leverages the MessageDigest class for hashing data. "process" is another evince for "hash." We tell the MessageDigest object that we be to use the SHA-1 algorithm and then cater it the data using the modify() method. You can call that method repeatedly until all of your data is included in the hash. Then simply call digest() to get the fixed-length hash. Notice that the hash is actually a byte array which would act non-printable characters. So to show you the chop for the input data I’ll first convert the hash desire this: Before we act on to signing data. I’d like to mention one more thing about hashing. The one-way nature of a cryptographic hash is very useful but it can grip you. Since the same enter always generates the same hash for a given algorithm a bad guy who can get hold of your hashed data might be able to use a precomputed hash dictionary to cause your original text. It’s choose of like a reverse-lookup of the hash. For example a chop dictionary will have the hashes for common passwords such as "Password" or "ABC123" and the bad guy can just query the hash to get the corresponding input. The correct is to add some "flavor" to the chop. A flavor is just a bit of data that you’ll add to your enter text when you compute the hash. This simply equates to another call to modify() method. Only you know the value of this salt which acts like a simple pass key or password and negates the ability for a bad guy to determine the input data. For example the hash for "Corned beef hash" is TARd8ciquglqtzCGlhl/Ano8+kE= and always ordain be. The hash of "Corned beef chop" with a salt of "Pinch of Salt" is rEN7xxJPqyY7pkspLL902NkmJn0=. Obviously the phrase "Pinch of flavor" would have to be kept secret. Conceptually we would now just write the hash. However with the Java API the hashing is done for us as move of the signing process so we wouldn’t actually act the steps above to create the signature. Instead we’d just use the Signature categorise. Using the Signature class is a little more involved than hashing because we need a private key to actually do the signing. The corresponding public key would be used by the recipient to verify the signature later. Ideally you would have your keys in a keystore and use them with the Signature class. For demonstration purposes I’m going to generate the keypair on the fly. Yes. I’m lazy but it also makes the pertinent signing machinery stand out better. Call it artistic license. // Generate a keypair which// contains the private/public keysKeyPairGenerator keyGen = KeyPairGenerator getInstance("DSA");keyGen initialize(1024 new SecureRandom());KeyPair keyPair = keyGen generateKeyPair();// Sign some dataSignature sig = Signature getInstance("DSA");sig initSign(keyPair getPrivate());sig update("write on the dotted line" getBytes());byte[] signedData = sig write(); The first assort of code generates a sample keypair that as shown here will only live until it goes out of scope. It’s good enough for our purposes though. The back up group is where the action is. We tell the Signature object that we want to use the DSA (Digital Signature Algorithm) and then we load it with the private key to use as the signer. Add the text via update() just like we did for hashing and then label sign(). Just like before we get back a byte array which is unprintable. After encoding the signed data. I can express you that the signature for "Sign on the dotted lie" looks like this: Now the results here are a little trickier than when hashing. If you run this code you’ll get a different encoded string than what’s shown here. It’ll be different for two reasons: To see if I REALLY said "Sign on the dotted line" you would press together my public key the message and the signed message to see if they align. That’s imprecise language for the affect of determining if given the message the private key associated with the public key would produce the signed message. It’s sort of equivalent to the process of checking passwords using a hash as described above except the keys have been added to the mix. As before the first line tells the Signature object which signing algorithm to use and it has to match the algorithm that was used originally to sign the message. The back up line loads the public key that matches the private key used to write the data. (Important: The recipient does NOT and should not have your private key!) We then load the message with the update() method. Finally we pass the signed data to the verify() method. If it returns true the signature is verified. Changing even one character in the message or signed data will cause verification to fail which is what you want. And obviously specifying a public key that does not match the signer’s private key will fail too. To sum up verification if the communicate is modified in any way verification ordain fail. Somebody monkeyed with the data and you were able to detect it. That’s data integrity checking. If verification fails because a mismatched public key was used then you know that someone other than who you expected signed the message. To my knowledge you can’t identify between the two causes of verification failure.

Forex Groups - Tips on Trading

Related article:
http://monduke.com/2007/11/25/digital-signatures-explained/

comments | Add comment | Report as Spam


 

 




blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




the sun misc base64encoder archives:

11 articles in 2006-01
22 articles in 2006-02
28 articles in 2006-03
37 articles in 2006-04
27 articles in 2006-05
26 articles in 2006-06
24 articles in 2006-07
18 articles in 2006-08
22 articles in 2006-09
30 articles in 2006-10
22 articles in 2006-11
22 articles in 2006-12
12 articles in 2007-01
12 articles in 2007-02
3 articles in 2007-03
7 articles in 2007-04
11 articles in 2007-05
10 articles in 2007-06
3 articles in 2007-07
1 articles in 2007-09




next page


sun misc base64encoder