login about faq

I need to do aes-128, cbc..without encoding at each step..i would like to do encoding only at the end..what functions should i use?

current implementation

  • crypt.SetEncodedIV
  • crypt.HashStringENC
  • crypt.EncryptStringENC

Required implementation

  • set iv without encoding
  • set hash (of key) without encoding
  • encrypt string without encoding (using key and IV)
  • concat iv to encrypted string
  • now base64 encode

which functions should i use?

asked Aug 07 at 02:46

samra's gravatar image

samra
11

edited Aug 07 at 02:54


IV As Variant

The initialization vector to be used with symmetric encryption algorithms (AES, Blowfish, Twofish, etc.). If left unset, no initialization vector is used.

SecretKey As Variant

The binary secret key used for symmetric encryption (Aes, Blowfish, Twofish, ChaCha20, ARC4, 3DES, RC2, etc.). The secret key must be identical for decryption to succeed. The length in bytes of the SecretKey must equal the KeyLength/8.

EncryptString(str As String) As Variant

Encrypts a string and returns the encrypted data as a byte array. The minimal set of properties that should be set before encrypting are: CryptAlgorithm, SecretKey, Charset. Other properties that control encryption are: CipherMode, PaddingScheme, KeyLength, IV. When decrypting, all property settings must match otherwise garbled data is returned. The Charset property controls the exact bytes that get encrypted. Languages such as VB.NET, C#, and Visual Basic work with Unicode strings, thus the input string is Unicode. If Unicode is to be encrypted (i.e. 2 bytes per character) then set the Charset property to "Unicode".

Concat of IV and Encoded bytes should be done with your builtin language functions.

Encode(byteData As Variant, encoding As String) As String

Encode binary data to base64, hex, quoted-printable, or URL-encoding. The encoding can be set to any of the following strings: "base64", "hex", "quoted-printable" (or "qp"), "url", "base32", "Q", "B", "url_rc1738", "url_rfc2396", "url_rfc3986", "url_oauth", "uu", "modBase64", or "html" (for HTML entity encoding).

link

answered Aug 07 at 08:45

jpbro's gravatar image

jpbro ♦
1.1k2618

edited Aug 07 at 08:45

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×20
×9

Asked: Aug 07 at 02:46

Seen: 118 times

Last updated: Aug 07 at 08:45

powered by OSQA