Lasso Soft Inc. > Home

[ cipher_sign ]

Method

 

cipher_sign(privateKeyBytes::bytes, passPhrase::bytes, data::bytes)

cipher_sign(privateKeyBytes::bytes, data::bytes)

This method takes the private key data and the optional passphrase and uses it to generate a signature for the provided data parameter. The return value is a bytes object containing a signature which can be used to verify the data at a later time.

  • 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