Company | Newzulu Platform | Developer

Developer Template Documentation v4.12.2.47

fm:Encrypt


fm:Encrypt Component

The fm:Encrypt component allows you to encrypt a key/value pair.
The key/value pair can be of any type and has to be passed together.
The component also allows the user to set the values for the optional parameters init_vector and secret_key, which can be of any variable type. This component was developed to encrypt media and user ids, so that media downloads can be tracked against each user.

Uses of the fm:Encrypt Component

One use of the fm:Encrypt component is to track the views (downloads) of media by users.
When you use the fm:Encrypt component to display a media, the views are tracked against the viewer, in the media usage table.
This differs from showing the media using < img src="http://fmdev.s3.amazonaws.com/storage/5048149/11" > which will log the view against the media views, (in the media table).

Example 1

The following code will encrypt media 5048299 (to be shown in size 15) and user 1927628 to a url that displays the image and logs its view against user 1927628.
Please note: if this code is to be used to log the user's bandwidth usage, then it is necessary to include the media size (15) to be shown, and to do so using "/15".

<img src='http://rstorage.filemobile.com/storage/s=<fm:Encrypt encrypt_key="id,uid" encrypt_value="5048299/15,1927628" />' >

Supported attributes

NameRequiredDefaultDescription
encrypt_keyRequiredN/A(Any variable type) The encrypted strings key. If more than one key needs to be provided please use a csv list.
encrypt_valueRequiredN/A(Any variable type) The encrypted strings value. If more than one value is provided please ensure the are delimited by commas.
init_vectorOptionalN/A(Any variable type) This is the initilization vector you will need to use with the provided secret_key
secret_keyOptionalN/A(Any variable type) If you want to pass the secret/key directly to the component you can use this optional key, if not used the system will use a self generated secret/key

See also

Example 2

The following code will encrypt the media and user ids while also setting the optional values for the init_vector and secret_key, which can be of any type.

<img src='http://rstorage.filemobile.com/storage/s=<fm:Encrypt encrypt_key="id,uid" encrypt_value="5048299/15,1927628" init_vector="erbEF$2_24_lst" secret_key="gbe734&#&@_3e" />' >
<< 3.2.12 fm:Else 3.2.14 fm:EventInfo >>