Skip to Content
Base64 encoding and decoding functionality is supported by both SAP and PHP. Once I tried the same for a BSP application, after reading this information in  ABAP Forums (Encode and Decode Base64) . It was a very good tip and also the forum thread   provided a link  (http://makcoder.sourceforge.net/demo/base64.php)  for a PHP utility for encoding and decoding using the Base64. I tried  the same for PHP and SAP integration for sending and receiving encoded data  between them. The sample application is given below which will perform the below  mentioned tasks    1. PHP will encode the SAP User Name using base64 and make an RFC call to SAP system,   2. SAP in turn decrypts the SAP User Name and fetches the SAP User Profile details, encrypts them and send them back to PHP,   3. PHP will decode the details and displays them in the browser.   The ABAP Function Module  for this example is given below,   A structure to hold the profile details,  image
To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Alvaro Tejada Galindo
    Hi Kathirvel:

    Your blog is really great! Both ABAP and PHP Encoding functions are easy to understand and implement -:D

    A great tool to improve PHP/SAP Integration security -;)

    Greetings,

    Blag.

    (0) 
  2. Anton Wenzelhuemer
    hi,

    base 64 encoding provides, as it’s name suggests, only encoding and not encryption. once you know that something is base64 encoded you just need to decode it. And base64 encoded content is easily identifiable as such.

    At best you get ‘security by obfuscation’ but no more.

    For real encryption the PHP side provides some libraries, which are to be used for example like
    [code]
    $encrypted_data = mcrypt_ecb (MCRYPT_3DES, $key, $input, MCRYPT_ENCRYPT);
    [/code]

    For some simple explanations of Base64 en/decoding and its purpose goto wikipedia or read the libraries’ documentation.

    anton

    (0) 
    1. Kathirvel Balakrishnan Post author
      Hi Anton

      Your point is valid. Although my first para says “encoding and decoding using the Base64” the title is misleading as “Encryption and Decryption”. Fixed that.
      Cheers Kathir

      (0) 
      1. Anton Wenzelhuemer
        hi,

        great that you corrected it.

        Now that we’ve made clear that it has nothing to do with encryption, the question remains open what it is good for to base64 encode simple strings.

        anton

        (0) 

Leave a Reply