Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4756] Titanium.Codec needs to be extended to include the variations of encoding / encryption that are already available on the native platforms

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2011-11-01T12:11:42.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-42, Release 1.8.0
ComponentsiOS
Labelsmodule_utils, parity
ReporterJohn V Pataki
AssigneeBlain Hamon
Created2011-07-22T20:06:36.000+0000
Updated2017-03-21T18:27:36.000+0000

Description

Currently the Titanium.Codec module provides several options for encoding and decoding. A current project I am on needs HMAC SHA256 but it is not available and I have to go outside of the framework to get this encryption method. The iOS SDK's CommonCrypto class ( for HMAC SHA256) already has this and many more encoding/decoding variants available that could be surfaced to enhance this Ti module. It would be nice if the Ti.Codec module was complete with all encryption options.

Comments

  1. Blain Hamon 2011-08-08

    There appears to be a bit of confusion here. Codec module is about ensuring that integers, strings, booleans, floats, etc can be serialized and transported over a stream, and come out the right order on the other side regardless of changes of endianness. Codec is NOT about encryption and decryption. The place for encryption appears to be in the utils module, which already has a sha1 function. A sha256 function will be added here, NOT in codec.
  2. John V Pataki 2011-08-08

    Blain, can you add the regular SHA256 and the HMAC SHA256 functions when you add them?
  3. Blain Hamon 2011-08-15

    Quick test to test sha256:
       //Sample sha taken from Wikipedia.
       var sha2 = Ti.Utils.sha256("The quick brown fox jumps over the lazy dog.");
       Ti.API.debug("sha2 test => " +sha2 +" should be => " +
       "ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c: " +
       (sha2 == 'ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c'));
       
  4. Lee Morris 2017-03-21

    Closing ticket as fixed.

JSON Source