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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Cross platform encryption issues / PHP & VB.NET Interop [SOLVED]

Cross platform encryption issues / PHP & VB.NET Interop [SOLVED]

Scheduled Pinned Locked Moved Visual Basic
helpcsharpjavaphp
1 Posts 1 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.
  • G Offline
    G Offline
    green2go
    wrote on last edited by
    #1

    Dear All, I am developing a small VB.NET application to interface using a web client to pass data between the app and a PHP driven back end. I want to secure the data travelling between the two systems. I have been playing about with the encryption methods outlined in Jeff Atwoods article '.NET Encryption Simplified' using symmetric encryption with the Rijndael algorithm with the default key size (256) also setting the key & iv with strings which has been working perfectly both encrypting and decrypting in VB.NET and outputting to a readable base64 string. Now this is where it gets confusing. I have setup a basic PHP script to try and get the same base64 string that VB produces out of PHP using mcrypt. In short I can't get the two strings to tie up (probably due to my lack of knowledge :doh:). I have mcrypt setup with the same key, keysize, algorithm, iv & mode (CBC). I try to encode the word 'test' and PHP will spit out a base64 string 44 chars long and VB will generate one 24 long! What I would like to know is has anyone tried doing this before?? Any pointers as where I could be going wrong?? As far as i'm aware at the moment this shouldn't be too much of an issue?? (i.e. encrypting / decrypting between PHP & VB.NET). I'm sorry for being a bit vague. UPDATE: I now believe it is the padding type between PHP & VB.NET. PHP Mcrypt padding with 0x00 and VB.NET PKCS. UPDATE: It was the padding type! :) If anyone is having the same problem, you need to pad the string input with PKCS5 to the required block size before feeding it to PHPs mcrypt. I have also found the same is true with VB.NET & Java interop. Thanks in advance Oli -- modified at 7:52 Monday 26th March, 2007

    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