encryption php

11
Encryption

Upload: prodigyview

Post on 09-Jun-2015

1.387 views

Category:

Technology


0 download

DESCRIPTION

Learn how encrypt and decrypt data in ProdigyView.

TRANSCRIPT

Page 1: Encryption PHP

Encryption

Page 2: Encryption PHP

Overview

Objective

Learn how to encrypt and decrypt data.

Requirements

Version of ProdigyView

Estimated Time

8 Minutes

www.prodigyview.com

Page 3: Encryption PHP

Follow Along With Code Example

1. Download a copy of the example code at www.prodigyview.com/source.

2. Install the system in an environment you feel comfortable testing in.

3.Proceed to examples/security/Encryption.php

Page 4: Encryption PHP

Encrpytion A NightmareThe first time coming across encryption and php mcrypt can be something like this:

Page 5: Encryption PHP

Encryption Made EasyThankfully encryption is not like that in ProdigyView. Start this example by calling the PVSecurity::init and lets create a string to encrypt.

1. Initialize the security class

2. String to encode

Page 6: Encryption PHP

Encrypting DataEncrypting data is easily accomplished by passing data into the PVSecurity::encrypt method.

Encrypt the string

Page 7: Encryption PHP

Encrypting StringTrying to read an encrypted string will give you this result.

To read that message, we have to decrypt the message in PVSecurity::decrypt

Page 8: Encryption PHP

Encrypting with Key

By default, the key used is defined in the PVSecurity::init. A custom key can be used when encrypting a string and only that key can be used to decrypt it.

Custom key for encrypting

Page 9: Encryption PHP

Decrypting with Custom Key

Decrypting with the key used for encryption will return this.

Our last string we encrypted was with a set key. Decrypting without the correct key will give us this.

Page 10: Encryption PHP

Review

1. Encrypt a file with PVSecurity::encrypt.

2. Decrypt a file with PVSecurity::decrypt.

3. Custom key have can be added in the options of encrypt and decrypt.

4. PVSecurity::init contains the default configuration for encrypting and decrypting data.

Page 11: Encryption PHP

API ReferenceFor a better understanding of Validation in ProdigyView, visit the api by clicking on the link below.

PVSecurity

www.prodigyview.com

More Tutorials

For more tutorials, please visit:

http://www.prodigyview.com/tutorials