Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Encrypting The string

Encrypting The string

Scheduled Pinned Locked Moved ASP.NET
algorithms
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RajpootRohan
    wrote on last edited by
    #1

    Hi to all, Actually I am working on a e-commerce portal. We are using sage pay (payment gateway) for the transaction.While sending data to sage for transaction, the data should be encrypted. For this data should be encrypted using Simple XOR algorithm and then should be Base64 encoded. Can anyone have any idea about this. I am trying like this:

    public void gencrypt()
    {
        string mycrypt = "";
        key = "EnNj72dXmScJUX45";
        string mystring = strPost;
        string temp = "";
    
        SimpleXor(mystring, key);
        Base64Encode(temp);
    }
    
    public void SimpleXor(string strIn, string strkey)
    {
        int iInIndex;
        int iKeyIndex;
        string strReturn;
    
        if (strIn.Length == 0 || strkey.Length == 0)
        {
            return;
        }
        iInIndex = 1;
        iKeyIndex = 1;
        strReturn = "";
        for (int i = 0; i <= strIn.Length; i++)
        {
            for (int j = 0; j <= strkey.Length;j++ )
            {
                strReturn = strReturn + (strIn\[i\] ^ strkey\[j\]);
                iInIndex = iInIndex + 1;
                if (iKeyIndex == strIn.Length)
                {
                    iKeyIndex = 0;
                    iKeyIndex = iKeyIndex + 1;
                }
            }
        }
    }
    
    public void Base64Encode(string strplain)
    {
    
    }
    

    Please assist me..

    cheers, sneha

    G 1 Reply Last reply
    0
    • R RajpootRohan

      Hi to all, Actually I am working on a e-commerce portal. We are using sage pay (payment gateway) for the transaction.While sending data to sage for transaction, the data should be encrypted. For this data should be encrypted using Simple XOR algorithm and then should be Base64 encoded. Can anyone have any idea about this. I am trying like this:

      public void gencrypt()
      {
          string mycrypt = "";
          key = "EnNj72dXmScJUX45";
          string mystring = strPost;
          string temp = "";
      
          SimpleXor(mystring, key);
          Base64Encode(temp);
      }
      
      public void SimpleXor(string strIn, string strkey)
      {
          int iInIndex;
          int iKeyIndex;
          string strReturn;
      
          if (strIn.Length == 0 || strkey.Length == 0)
          {
              return;
          }
          iInIndex = 1;
          iKeyIndex = 1;
          strReturn = "";
          for (int i = 0; i <= strIn.Length; i++)
          {
              for (int j = 0; j <= strkey.Length;j++ )
              {
                  strReturn = strReturn + (strIn\[i\] ^ strkey\[j\]);
                  iInIndex = iInIndex + 1;
                  if (iKeyIndex == strIn.Length)
                  {
                      iKeyIndex = 0;
                      iKeyIndex = iKeyIndex + 1;
                  }
              }
          }
      }
      
      public void Base64Encode(string strplain)
      {
      
      }
      

      Please assist me..

      cheers, sneha

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      I dont understand what your issue is - a little search prduces many ways of doing it, including this Implementing XOR cipher encryption / decryption in C#[^] but in reality Im not sure I'd be sending payment info to Sage or anyone else using simple xor encryption - if thats what they recommend I certainly wouldnt be dealing with them 'g'

      modified on Sunday, January 24, 2010 4:02 AM

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups