encryption of password using tranformations

6 views
Skip to first unread message

Jayaram Sudheer

unread,
Sep 27, 2012, 2:54:23 AM9/27/12
to activewareh...@googlegroups.com
haii, i want to encrypt the password using transformations in etl process, is it possible, if it is what is the process for that

Thibaut Barrère

unread,
Sep 27, 2012, 3:35:04 AM9/27/12
to activewareh...@googlegroups.com
Hello!
 
hi, i want to encrypt the password using transformations in etl process, is it possible, if it is what is the process for that

do you mean you have one field on each row with a password that you would like to encrypt?

If so, the first possibility I recommend is to use a "block" transform, because it's very quick to implement.

Imagine you have one field :plain_text_password. You could create an additional :encrypted_password column like this:

transform(:encrypted_password) do |n,v,r|
  encrypt_password(r[:plain_text_password])
end
The value returned by the block will be injected into the :encrypted_password attribute.

Please note that this is not a security advice, just a demo of how to use the block transform.

If you need to go further, you could also create a custom transform (let me know if you need help on that) but I don't think that's necessary here.

hope this helps,

Thibaut
--

Jayaram Sudheer

unread,
Sep 27, 2012, 6:00:08 AM9/27/12
to activewareh...@googlegroups.com
Thanks but is n't work for me my code is like this, my field name is password, and the encrypted values need to store directly in the password field


               :password => transform(:password) do |n,v,r|
                           encrypt_password(r[:password])
                 end

is anything wrong in this code................

Thibaut Barrère

unread,
Sep 27, 2012, 6:08:35 AM9/27/12
to activewareh...@googlegroups.com
Hi,
 
Thanks but is n't work for me my code is like this, my field name is password, and the encrypted values need to store directly in the password field

In that case you can just write:

transform(:password) do |n,v,r|
  encrypt_password(v)
end

Think about it this way: calling "transform" does not execute the transform code, but instead registers a transform in the pipeline, which just happen to be a block transform in this case.

Later when rows are processed, the block is called on each row, with n and v the name of the field and its value, respectively (and r the full row).

So if you use the same for the source and target field, you can just rely on the value.

Recommended reading before you go any further:
https://github.com/gmgp/activewarehouse-etl/wiki (temporary state but will still be helpful)

hth,

Thibaut
--

Reply all
Reply to author
Forward
0 new messages