Lasso Soft Inc. > Home

[ cipher_verify ]

Method

 

cipher_verify(publicKeyBytes::bytes, data::bytes, signature::bytes)

This method takes the public key data and the signature parameter and uses them to validate the data against the signature. The signature should have been obtained by first calling [cipher_sign].

  • Syntax
No syntax description available at this time.
Examples
  • Beginner

 

This example generates a new private/public key pair and uses them to first sign a block of data and then verify the data both successfully and then unsuccessfully.

Code

local(privKeyBytes, pubKeyBytes) = cipher_generate_key // default 2048 bits

//	sign/verify
	local(data = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software \
		like Aldus PageMaker including versions of Lorem Ipsum."->asBytes)
	local(data2 = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.  Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software \
		like Aldus PageMaker including versions of Lorem Ipsum."->asBytes)
		
	local(digitalSig = cipher_sign(#privKeyBytes, #data))

	'\n'
	cipher_verify(#pubKeyBytes, #data, #digitalSig)
	'\n'
	cipher_verify(#pubKeyBytes, #data2, #digitalSig)

Result

true
false

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft