Platforms to show: All Mac Windows Linux Cross-Platform

Back to ECKeyMBS class.

ECKeyMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.

ECKeyMBS.Copy as ECKeyMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the key.

ECKeyMBS.Generate as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Generates new key and stores in the current object.

Returns true on success or false on failure.

ECKeyMBS.GetPrivateKey(Hex as Boolean) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries priv key.
Example
// make a key
Const NID_secp192k1 = 711
Dim e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

// show private key
MsgBox e.GetPrivateKey(True)+_
EndOfLine+_
e.GetPrivateKey(False)

The private key is a big number, which can be returned as decimal or hexadecimal value.

ECKeyMBS.GetPublicKey(byref x as String, byref y as String, Hex as Boolean) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries X and Y of public key.
Example
// make a key
Const NID_secp192k1 = 711
Dim e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

// show public key
dim x,y as string
If e.GetPublicKey(x, y, False) Then
MsgBox x+EndOfLine+y
End If

The public key is made up with two big numbers, which can be returned as decimal or hexadecimal value.
Returns true on success or false on failure.

ECKeyMBS.GetPublicKeyPoint as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries Public key as hex string.
Example
// make a key
Const NID_secp192k1 = 711
Dim e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

// show public key
msgbox e.GetPublicKeyPoint

Can be queried to save/send and later be assigned with SetPublicKeyPoint.

ECKeyMBS.PrivateKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries the priv key.
Example
const NID_secp192k1 = 711
dim key as ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)
dim Data as string = key.PrivateKey
MsgBox EncodeBase64(data)

ECKeyMBS.PublicKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries the public key.
Example
const NID_secp192k1 = 711
dim key as ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)
dim Data as string = key.PublicKey
MsgBox EncodeBase64(data)

ECKeyMBS.SetPrivateKey(Value as String, Hex as Boolean) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the key.
Example
// make a key
Const NID_secp192k1 = 711
Dim e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

MsgBox e.Description

// get hex
Dim pubk As String = e.GetPublicKeyPoint
Dim priv As String = e.GetPrivateKey(False)


// make new empty key and put in the data
Dim ee As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1, False)

If ee.SetPrivateKey(priv, False) Then
If ee.SetPublicKeyPoint(pubk) Then
MsgBox ee.Description
Else
Break // failed?
End If
Else
Break // failed?
End If

Returns true on success or false on failure.

ECKeyMBS.SetPublicKey(x as String, y as String, Hex as Boolean) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets X and Y of public key.
Example
// make a key
Const NID_secp192k1 = 711
Dim e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

MsgBox e.Description

// get hex
Dim pubk As String = e.GetPublicKeyPoint
Dim priv As String = e.GetPrivateKey(False)


// make new empty key and put in the data
Dim ee As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1, False)

If ee.SetPrivateKey(priv, False) Then
If ee.SetPublicKeyPoint(pubk) Then
MsgBox ee.Description
Else
Break // failed?
End If
Else
Break // failed?
End If

Returns true on success or false on failure.

ECKeyMBS.SetPublicKeyPoint(Value as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets public key.

Returns true on success or false on failure.

ECKeyMBS.Sign(Data as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Signs the given data.
Example
const NID_secp192k1 = 711
dim key as ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)
dim text as string = "Hello World"
dim data as string = SHA512MBS.Hash(text)
dim sig as string = key.Sign(data)

if key.Verify(data, sig) then
MsgBox "Signature ok"
end if

We highly recommend to use a hash like SHA-512 to preprocess the data.
Returns the signature as string on success.

ECKeyMBS.Verify(SignatureData as String, Data as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Verifies the digital signature.
Example
const NID_secp192k1 = 711
dim key as ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)
dim text as string = "Hello World"
dim data as string = SHA512MBS.Hash(text)
dim sig as string = key.Sign(data)

if key.Verify(data, sig) then
MsgBox "Signature ok"
end if

Returns true on success. Returns false if data, signature and public key don't belong together.
We highly recommend to use a hash like SHA-512 to preprocess the data.

The items on this page are in the following plugins: MBS Encryption Plugin.


The biggest plugin in space...