Rocket Uniface User Forum

 View Only

Enhancing Security and Efficiency: Introducing Base64URL Encoding and Elliptic Curve Cryptography

By Kathy Larson posted 11-14-2023 11:21

  

by Dongbo Zhang

We are excited to announce a significant update to the Uniface ProcScript language that brings powerful new features to enhance both the security and efficiency of your applications. Our commitment to providing you with top-notch solutions has driven us to integrate Base64URL encoding and Elliptic Curve Cryptography (ECIES, ECDSA, and Ed25519) into $encode and $decode functions.

Base64URL Encoding: Simplifying Data Handling

Base64URL encoding is a URL-safe variant of the traditional Base64 encoding. It allows you to represent binary data safely in text format, making it ideal for use in URLs, JSON, and other contexts where you need to avoid certain characters. With Base64URL encoding supported by $encode and $decode, you can seamlessly exchange data in a more efficient and secure manner.

Elliptic Curve Cryptography: A Leap Forward in Security

Elliptic Curve Cryptography (ECC) is an approach for asymmetric key cryptography, offering versatile applications in both encryption and digital signatures. It offers strong security with shorter key lengths compared to other asymmetric cryptographic algorithms.

We introduced three Elliptic Curve Cryptography schemes into $encode and $decode functions:

  1. ECIES (Elliptic Curve Integrated Encryption Scheme): ECIES combines the benefits of public key encryption and symmetric key encryption. This provides robust security and efficient data exchange, making it suitable for secure communication and data protection.
  2. ECDSA (Elliptic Curve Digital Signature Algorithm): ECDSA enables secure digital signatures, ensuring the authenticity and integrity of data. It plays a crucial role in verifying the origin of the data, making it indispensable for applications such as digital certificates and data validation.
  3. Ed25519: Ed25519 is a high-speed, high-security Elliptic Curve Signature scheme. It is known for its efficiency and strong security properties, making it a top choice for applications where performance and safety are critical.

Benefits You Can Expect:

  • Enhanced Security: Your data will be more secure than ever, thanks to the robust encryption and digital signature capabilities offered by Elliptic Curve Cryptography.
  • Efficiency: Base64URL encoding simplifies data representation and transmission, reducing the complexity of your workflows. Elliptic Curve Cryptography utilizes simpler and faster mathematical operations, making it a preferred choice for efficiency.
  • Compatibility: These features are widely supported, ensuring seamless integration with existing systems and protocols.

Usage Samples:

1.     Base64URL Encoding and Decoding

; Base64URL Encoding

Base64URL_encoded = $encode("BASE64URL", "- test string -")

; Base64URL_encoded will result in "LSB0ZXN0IHN0cmluZyAt"

 

; Base64URL Decoding

Base64URL_decoded = $decode("BASE64URL", Base64URL_encoded)

; Base64URL_decoded will be decoded back to "- test string -"

2.     Data Encryption with ECIES

; To get started, please follow the guidelines in our documentation to generate your private and public keys first

; Load keys
fileload "myPrivateKey.pem", vMyPrivateKey
fileload "myPublicKey.pem", vMyPublicKey
; Encrypt data by ECIES ECP with SHA-512 hash
ciphertext = $encode("ECIES_ECP_SHA512", plaintext, vMyPublicKey)
; Decrypt the ciphertext
plaintext = $decode("ECIES_ECP_SHA512", ciphertext, vMyPrivateKey)

3.     Data Signing and Verifying with ECDSA

; To sign and verify data with ECDSA, you also need to generate private and public keys first

; Load keys
fileload "myPrivateKey.pem", vMyPrivateKey
fileload "myPublicKey.pem", vMyPublicKey

; Sign a message by ECDSA ECP with SHA512 hash.
vSignature = $encode("ECDSA_ECP_SHA512, vMessage, vMyPrivateKey)
; Verify the signed message.
if ($decode("ECDSA_ECP_SHA512", vMessage, vMyPublicKey, vSignature))
    message/info "This is a valid message."
else
    message/info "Signature doesn’t match with the message."
endif

To take advantage of these new features, simply upgrade to the latest version of Uniface. Our user-friendly documentation and support team are available to assist you in implementing these enhancements in your projects.

We are committed to continuously improving Uniface to meet your evolving needs. Your feedback is invaluable, so please do not hesitate to share your thoughts with us.


#tofp
0 comments
8 views

Permalink