In this topic, I will be talking about encryption and decryption using OpenSSL in PHP. I will be briefly discussing what “two way encryption” is and how to use it in your PHP application using OpenSSL encrypt and decrypt methods with a readily usable example. At the end of this page there will be a zip file where you can download and run the example.
Two way encryption (encryption and decryption) is the simplest way of securely sending some sensitve information over the Internet using a shared secret key. To make things understandble picture this scenario. A web user fills a form with some data and press the submit button. When the form is submitted, data will go from place A to place B. If we send data as it is, anyone (i.e. Spy) has access to data packets can open and see what’s inside. So, before sending data as it is we will use a convertion method (encryption) to transform human readable data (i.e. Plain text) into a human unreadable format (i.e. Cipher text). Then the receiving end will perform a data convertion exercise (decryption) to transform data back to readable format.
(Image URL :- https://commons.wikimedia.org/wiki/File:Crypto.png)
How are you doing? Seems like my fingers do not want me to stay away from Symfony2 despite the Spring Bank Holiday. 🙂
Today, I am going to talk about how to call an Oracle Function in Symfony2. A function (aka stored function) is a collection of SQL statements which is used to perform various different activities within the Database. The good thing about the function is you can write your chunks of SQL inside the function and call it using a name to initiate. I will be focusing on how to call an Oracle Function in Symfony2 and if you would like to know more about Oracle functions please click here.
First, let’s take a look at a sample function which I have created and is saved in Oracle 12c Database.
create or replace
FUNCTION testFunc123(old_bname IN VARCHAR2)
RETURN VARCHAR2 IS
IF old_bname = 'TEST' THEN
The role of the above created Oracle function is to check whether the value of ‘old_name’ is equal to ‘TEST’ or not. If it is ‘TEST’, then the function will return ‘Y’ otherwise ‘N’. So, now what we going to do is call this function inside a Symfony2 controller. This is really easy, thankfully to wonderful Doctrine2.
I am pretty excited to see WordPress 4.3’s new formatting shortcuts. It makes blogging life lot easier with newly added formatting shortcuts. Here I am going to list those shortcuts for you.
- Use ## to make a text h2, ### to make a text h3 and all the way to h6. (By the way no h1 is available, so you can’t just use one #, perhaps another approach ?)
- Use * (asterisk) or – (dash) to create an unordered list. Make sure you give a space after the asterisk / dash. However I found it little bit difficult to create an unordered list with dash, so I always use asterisk.
- Use 1. or 1) to make an ordered list. Make sure there’s no space between the 1 and dot but a space after the dot. However I found it little bit difficult to create an ordered list with 1) over 1(dot). So I always use 1(dot).
- Use > to make a quoted text. Once again make sure you give a space after the greater than sign.
These are the shortcuts what I have found so far, but there will be more in future. Text formatting shortcuts is not the only new feature in WordPress 4.3. Watch this video below to see new features in WordPress 4.3. Continue reading