I am not able to figure out how to build a hexadecimal block, if I have all the needed information (Hash, Merkel Root, etc.).
Please use this JSON formatted block as reference: Block #506398
I understand the first 64 bytes are the block header, however what about the rest of the bytes?
Thanks For Your Help!
Here you have some articles about bitcoin block structure:
https://medium.com/all-things-ledger/bitcoins-implementation-of-blockchain-2be713f662c2
https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b
https://medium.com/capital-one-developers/bitcoin-blockchain-and-building-blocks-9f304380c77d
Please keep in mind that JSON is not compatible with bitcoin protocol. It is a easy to read representation of original block.
Related
I've been programming in Power Apps for some time now (but I'm not a specialist). I'm trying to pass an array from Power Automate to Power Apps.
I was able to do that with a string and after a few more steps I have the following text:
[{"Messung":1;"Tiegel leer":"16;5469";"Tiegel Probe":"27;6659";"Tiegel Asche":"17;6549"}]";"[{"Messung":2;"Tiegel leer":"16;9654";"Tiegel Probe":"26;5476";"Tiegel Asche":"17;6549"}]";"[{"Messung":3;"Tiegel leer":"17;0256";"Tiegel Probe":"27;9862";"Tiegel Asche":"18;2235"}"]
I would like to convert this back to a data table with a MatchAll command, unfortunately I do not understand the Microsoft explanation for this command at all. I can convert the semicolons in the values back into commas later, but I needed the semicolons (language dependency, programming in German)
My plan was to do the conversion using a ClearCollect(MatchAll....) command.
I seem to be able to get these individually for my individual columns
(; <Tiegel_leer>;<Tiegel_Probe> & <Tiegel_Asche>).
ClearCollect(ResultAG;MatchAll(Label40_1.Text;"(""Messung"":(?[^""]))"));;
ClearCollect(ResultAG;MatchAll(Label40_1.Text;"(""Tiegel Probe"":(?<Tiegel_Probe>[^""]))"));;
ClearCollect(ResultAG;MatchAll(Label40_1.Text;"(""Tiegel leer"":(?<Tiegel_leer>[^""]))"));;
ClearCollect(ResultAG;MatchAll(Label40_1.Text;"(""Tiegel Asche"":(?<Tiegel_Asche>[^""]))"))
But I can't connect these lines with each other and I still don't really understand it. These lines were also created more by trial and error than by understanding.
Would be glad if someone could help me with this.
Thanks for helping
Using MatchAll approach is very old and complex approach to parse the array of objects (data) sent from Power automate to Power apps.
I would suggest you to use the recently released ParseJSON function in Power apps instead of MatchAll function for this.
For detailed information and tutorial, check:
Power Fx: Introducing ParseJSON
ParseJSON function in Power Apps (experimental)
ParseJSON function in Power Apps - Video
I have tried with ModifyRequest but unfortunately I was not able to find the proper way.
I see it is very straightforward to do with DirectoryEntry but I must use the raw LdapConnection since it is the only way that allows authentication through client certificates.
If anyone has any solution or ideas, it would be great to discuss it.
I haven't really used LdapConnection as I usually use DirectoryEntry, however, I did write an article about how to work with security descriptor attributes, which might help you: Active Directory: Handling NT Security Descriptor attributes
I talked about getting the value from DirectoryEntry and DirectorySearcher. However, I suspect LdapConnnection will give you a raw byte array, in which case the section on Getting the value from DirectorySearcher may help you, since that shows how to create an ActiveDirectorySecurity object from a byte array. For example, if you have the byte array in a variable called byteArray, you can do this:
var adSecurity = new ActiveDirectorySecurity();
adSecurity.SetSecurityDescriptorBinaryForm(byteArray);
Then you can use adSecurity.GetSecurityDescriptorBinaryForm() to convert it back to a byte array before writing it back to AD.
Im working on a script to hash a "fingerprint" for communicating with the secure Pay Direct Post API.
The issue I have is im trying to create a SHA-1 String that matches the sample code provided so that i can ensure things get posted accurately.
the example Sha-1 string appears encoded like
01a1edbb159aa01b99740508d79620251c2f871d
However my string when converted appears as
7871D5C9A366339DA848FC64CB32F6A9AD8FCADD
completely different...
my code for this is as follows..
<cfset variables.finger_print = "ABC0010|txnpassword|0|Test Reference|1.00|20110616221931">
<cfset variables.finger_print = hash(variables.finger_print,'SHA-1')>
<cfoutput>
#variables.finger_print#
</cfoutput>
Im using Coldfusion 8 to do this
it generates a 40 character hash, but i can see its generating completely different strings.
Hopefully someone out there has done this before and can point me in the right direction...
thanks in advance
** EDIT
The article for creating the Hash only contains the following information.
Example: Setting the fingerprint Fields joined with a | separator:
ABC0010|txnpassword|0|Test Reference|1.00|20110616221931
SHA1 the above string: 01a1edbb159aa01b99740508d79620251c2f871d
When generating the above example string using coldfusion hash it turns it into this
7871D5C9A366339DA848FC64CB32F6A9AD8FCADD
01a1edbb159aa01b99740508d79620251c2f871d
Sorry, but I do not see how the sample string could possibly produce that result given that php, CF and java all say otherwise. I suspect an error in the documentation. The one thing that stands out is the use of "txnpassword" instead of a sample value, like with the other fields. Perhaps they used a different value to produce the string and forgot to plug it into the actual example?
Update:
Example 5.2.1.12, on page 27, makes more sense. Ignoring case, the results from ColdFusion match exactly. I noticed the description also mentions something about a summarycode value, which is absent from the example in section 3.3.6. So that tends to support the theory of documentation error with the earlier example.
Code:
<cfset input = "ABC0010|mytxnpasswd|MyReference|1000|201105231545|1">
<cfoutput>#hash(input, "sha-1")#</cfoutput>
Result:
3F97240C9607E86F87C405AF340608828D331E10
I wish to generate a barcode mixing code128B and code128C with iTextSharp DLL. Do you know how to do that ? I currently know only with a single codeset.
By example, I wish to generate a barcode with the value 8L1 91450 883421 0550 001065
where "8L1 91450" is in code128B and "883421 0550 001065" is in code128C.
Thanks
Barcode128 will actually automatically switch from B to C if and when it can but it sounds like you don't want this. For the control that you're looking for you'll need to set your barcode's CodeType property to Barcode.CODE128_RAW and manually set the raw values.
There's a couple of posts out there that give the basic idea but unfortunately they tend to assume to much knowledge of iText or too much knowledge of barcodes.
I'm not a barcode expert either but the basic idea is to create a string that starts with Barcode128.START_B, then the first part of your text, then Barcode128.START_C and then the second. When in raw mode, text isn't ASCII, however. You can use this site to get the character codes for various ASCII values. But basically instead of sending the letter L you'd send (char)44.
Hopefully this gets you started at least.
I have some strings and some hashes of them, but I don't know which hash function is used. Any idea?
String hash
NN34W f8b46bcdc3b3c92
EM3M3 d8015ca876fd051
HXDKD a740e97464e5dfe
AKREJ aa7aa2dadfcbe53
3bNMK 0f11440639191d9
Edit:
Thank for answers, it's a hash of the captcha.
https://registracia.azet.sk/
If you check URL of captcha image, on the end is HASH value. This
On the server are send in HTTP POST are send TEXT: (P92M4) and HASH (72fec89a2e0ade2) and other values.
I like know how comptute hash of the TEXT P92M4, and control with HASH value, which is send on server.
Because I like make own captcha system for my school project, so I first analyzing situation and weakness.
As I understand your situation, a POST request sends both the "text" and the "hash" to the CAPTCHA server. This then uses whatever hash function they use to hash your text, checks to see if it matches the hash, and decides whether or not you succeeded. Presumably, the server sends you the image, as well as the hash, and then you enter the text.
As such, if you figured out the hashing function, you'd have completely broken this CAPTCHA system: All you would need to do is hash any string using their hashing function, and then when sending your POST request, ignore the hash they sent you and merely send them your computed text and hash pair. Thus, you could very easily automate successfully passing the CAPTCHA challenge.
To illustrate how difficult "reversing" the hash might be, consider the following hash that they very well might use:
Split the TEXT up alternating letters: thus ABCDE becomes ACE and BD
md5 the two halves using salts "fj49w0utw4a" and "r8h3wlsd"
md5("fj49w0utw4a"."ACE") is 115c05f0e5300f958ba01caa64b989f
md5("r8h3wlsd"."BD") is 74eecae86ef46382eb95443a1b1fa8f5
Take every 3rd char of the first string and every 4th char of the second, and alternate them until you have 15 chars
115c05f0e5300f958ba01caa64b989f becomes 55e09b1ab9
74eecae86ef46382eb95443a1b1fa8f5 becomes e8425af5
Final hash value for "ABCDE": 5e58e40295ba1fa
There is really no way you are ever going to reverse engineer that.
UPDATE
Note that CAPTCHAs as described above (and implemented on that site) are extremely insecure, as they only require one valid text/hash combination to be known
To demonstrate, use Firebug or equivalent and navigate to the CAPTCHA area of the form. We will be editing some hidden values.
Change the form[captcha_url] value from https://pokec.azet.sk/sluzby/system/captcha/[somehash] to https://pokec.azet.sk/sluzby/system/captcha/ee2be1f239e5d17
Change the form[captcha_hash] value from [somehash] to ee2be1f239e5d17
Regardless of what the picture says, type "P22KD" for the CAPTCHA
There are several ways to mitigate this vulnerability. As Tangrs suggested, you can store the hash value in a session variable so that it cannot be manipulated by the client. Less elegant but also effective is to store the submitted CAPTCHA in a database and not allow duplicate CAPTCHAs, as is implemented on the link in the question. This is fine, until you start running out of unused CAPTCHAs and end up getting collisions.
Seems smaller than any industry hash... possibly it's propriety?
A bit more info would help though, what language, where did you get it from?