two way encryption in PHP?

Posted on 2003-03-25
Medium Priority
Last Modified: 2012-05-05
can someone tell me if PHP has any two-way encryption functions? I dont wish to use libraries like mcrypt... just functions which are available in PHP. Also, i need it to be at least 128bit, as it will be used to encrypt credit card details.

I dont want to use any external classes developed by other people.

If there are any tutorials on the web which show how to do 128bit encryption with php, i would be grateful for links.
Question by:Mamady
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 15

Expert Comment

ID: 8205714
extended MD

Expert Comment

ID: 8206672
I found this very handy the other day. Has little to do with your question, but still very useful.


I've always used crypt() unfortunately it is One-way string encryption

Author Comment

ID: 8206761
thanks... but i have already implemented my own credit card verification system. Also, i always use md5 myself, but im really in need of a 2 way encryption method now. Im using mcrypt right now, but i need to move away from this urgently because i need it to run on a server where mcrypt is not installed. (i dont have access to the server, so i cant recompile php, or ask that php be recompiled to include the mcrypt library)
Tutorial: Introduction to Managing a Linux Server

In this tutorial on systemd, we will explore:
-OS/Distro Adoption
-chkconfig and Other Legacy Commands
-Summary and Key Commands


Accepted Solution

Kriek earned 60 total points
ID: 8207109
I think it's pretty safe to say that you aren't going to find any two-way encryption functions in php, "secure" ones anyway.

Encryption and Decryption using PHP and GnuPG:

Expert Comment

ID: 8209129
I think you should look into SSL. You need to get a licence and install it. Ask your host about adding this in, or alternatively go with a third party company that processes your cedit cards for you, such as Worldpay.

Author Comment

ID: 8210236
ssl encrypts information being sent from the browser to the server... once it reaches the server, the information is no longer encrypted.

I already have an ssl cert. for the domain.

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question