In Public key infra structure, The MD5 of the data is encrypted with private key of sender and this encypted md5 along with the data is again encryted using AES or 3DES algo. here key used to encrypt with AES is encrypted with private key of sender. Is this correct?
DATA// text which should be send through PKI hash = MD5(DATA)
encrypthash = RSAENCRYPT(privatekey,hash)//hash encrypted using private key of sender
cipher= AES(KEY,DATA+hash)//param 1- key to encrypt, param 2- DATA and hash are concatnated
encryptkey = RSAENCRYPT(privatekey,KEY)// AES key encrypted with private key of sender
masterKEY = RSAENCRYPT(publickey,KEY)// encryptkey encrypted with public key of receiver
its a rough implementation. Am I right?