Encryption in asp.net c#
-
Hello, Hello friends i need your help.in my project i want to encrypt login details can anybody help me to solve this.... Regards Alex.
-
Hello, Hello friends i need your help.in my project i want to encrypt login details can anybody help me to solve this.... Regards Alex.
Hello Alex, It is always good to encrypt these login details): You can implement this in different ways. Here is a small code snippet which does exactly the same thing using JavaScript: <!-- Beginning of JavaScript - function encode(text) { Ref="1923786540chikjmonpqstuvrxydahgei" Result="" for (Count=0; Count<text.length; Count++) { Char=text.substring (Count, Count+1); Num=Ref.indexOf (Char); EncodeChar=Ref.substring(Num+1, Num+2) Result += EncodeChar } document.form1.pw.value=Result } // - End of JavaScript - -->
I have taken a look on this javascript earlier at http://www.webteacher.com/. This is a small example but it should get you started on encrypting these login details. Regards, Amit Pal
-
Hello Alex, It is always good to encrypt these login details): You can implement this in different ways. Here is a small code snippet which does exactly the same thing using JavaScript: <!-- Beginning of JavaScript - function encode(text) { Ref="1923786540chikjmonpqstuvrxydahgei" Result="" for (Count=0; Count<text.length; Count++) { Char=text.substring (Count, Count+1); Num=Ref.indexOf (Char); EncodeChar=Ref.substring(Num+1, Num+2) Result += EncodeChar } document.form1.pw.value=Result } // - End of JavaScript - -->
I have taken a look on this javascript earlier at http://www.webteacher.com/. This is a small example but it should get you started on encrypting these login details. Regards, Amit Pal
Thanks amit, But i need the code for encryption and decryption ,if possible using c# alex.
-
Thanks amit, But i need the code for encryption and decryption ,if possible using c# alex.
OK you want the code in C# means encryption at server side Why you want to Encrypt the value at the server side do you want to store that value in database something like that Best way is to have own algorithm to encrypt and decrypt the data
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
-
Thanks amit, But i need the code for encryption and decryption ,if possible using c# alex.
Dim d As New EncryptedData d.Algorithm.Name = CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3DES d.Content = "hello" d.SetSecret("23456", CAPICOM_SECRET_TYPE.CAPICOM_SECRET_PASSWORD) Dim textenc As String = d.Encrypt(CAPICOM_ENCODING_TYPE.CAPICOM_ENCODE_BASE64) Response.Write(textenc) Dim d1 As New EncryptedData d.Algorithm.Name = CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3DES d.SetSecret("23456", CAPICOM_SECRET_TYPE.CAPICOM_SECRET_PASSWORD) d.Decrypt(textenc) Dim textdec As String = d.Content() Response.Write(textdec) Try the above , the value given as string in the function SetSecret is the key I am using , u can use anything. Add a reference to Capicom in ur project and then implement the same
-
Dim d As New EncryptedData d.Algorithm.Name = CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3DES d.Content = "hello" d.SetSecret("23456", CAPICOM_SECRET_TYPE.CAPICOM_SECRET_PASSWORD) Dim textenc As String = d.Encrypt(CAPICOM_ENCODING_TYPE.CAPICOM_ENCODE_BASE64) Response.Write(textenc) Dim d1 As New EncryptedData d.Algorithm.Name = CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3DES d.SetSecret("23456", CAPICOM_SECRET_TYPE.CAPICOM_SECRET_PASSWORD) d.Decrypt(textenc) Dim textdec As String = d.Content() Response.Write(textdec) Try the above , the value given as string in the function SetSecret is the key I am using , u can use anything. Add a reference to Capicom in ur project and then implement the same
Hi thanks, I couldn't able to implement this in asp.net c# can you help me. alex.
-
Hi thanks, I couldn't able to implement this in asp.net c# can you help me. alex.
string strencrypteddata=""; EncryptedData encryptdata = new EncryptedDataClass(); encryptdata.Algorithm.Name = CAPICOM.CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3DES; encryptdata.Algorithm.KeyLength = CAPICOM.CAPICOM_ENCRYPTION_KEY_LENGTH.CAPICOM_ENCRYPTION_KEY_LENGTH_MAXIMUM; encryptdata.SetSecret("dasdsads",CAPICOM.CAPICOM_SECRET_TYPE.CAPICOM_SECRET_PASSWORD); encryptdata.Content = "hello"; strencrypteddata = encryptdata.Encrypt(CAPICOM.CAPICOM_ENCODING_TYPE.CAPICOM_ENCODE_BASE64); decryption :::: string strencrypteddata1; EncryptedData encryptdata1 = new EncryptedDataClass(); encryptdata1.Algorithm.Name = CAPICOM.CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3DES; encryptdata1.Algorithm.KeyLength = CAPICOM.CAPICOM_ENCRYPTION_KEY_LENGTH.CAPICOM_ENCRYPTION_KEY_LENGTH_MAXIMUM; encryptdata1.SetSecret("dasdsads",CAPICOM.CAPICOM_SECRET_TYPE.CAPICOM_SECRET_PASSWORD); encryptdata1.decrypt(strencrypteddata ); Response.Write(encryptdata1.Content);
-
string strencrypteddata=""; EncryptedData encryptdata = new EncryptedDataClass(); encryptdata.Algorithm.Name = CAPICOM.CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3DES; encryptdata.Algorithm.KeyLength = CAPICOM.CAPICOM_ENCRYPTION_KEY_LENGTH.CAPICOM_ENCRYPTION_KEY_LENGTH_MAXIMUM; encryptdata.SetSecret("dasdsads",CAPICOM.CAPICOM_SECRET_TYPE.CAPICOM_SECRET_PASSWORD); encryptdata.Content = "hello"; strencrypteddata = encryptdata.Encrypt(CAPICOM.CAPICOM_ENCODING_TYPE.CAPICOM_ENCODE_BASE64); decryption :::: string strencrypteddata1; EncryptedData encryptdata1 = new EncryptedDataClass(); encryptdata1.Algorithm.Name = CAPICOM.CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3DES; encryptdata1.Algorithm.KeyLength = CAPICOM.CAPICOM_ENCRYPTION_KEY_LENGTH.CAPICOM_ENCRYPTION_KEY_LENGTH_MAXIMUM; encryptdata1.SetSecret("dasdsads",CAPICOM.CAPICOM_SECRET_TYPE.CAPICOM_SECRET_PASSWORD); encryptdata1.decrypt(strencrypteddata ); Response.Write(encryptdata1.Content);
Hi sorry for the disturbance.. how can i declare this EncryptedData encryptdata = new EncryptedDataClass(); i coudn't able to is there specific name space is needed i added using System.Security.Cryptography; but still problem pls help me alex
-
Hi sorry for the disturbance.. how can i declare this EncryptedData encryptdata = new EncryptedDataClass(); i coudn't able to is there specific name space is needed i added using System.Security.Cryptography; but still problem pls help me alex
-
I had written in the first mail itself to add a reference to Capicom in ur solution and then write using Capicom and then u will b able to use this code
sorry i am confucing, From where i will add reference to my project...i mean Capicom.. alex
-
sorry i am confucing, From where i will add reference to my project...i mean Capicom.. alex
I suppose u have ur solution opened in front of u , You will be able to see a references folder , right click , add reference . Click on the COM tab and there look for Capicom. select the same and then it will appear in the references folder in ur solution. Now in ur page add the line using Capicom. Is it ok now
-
I suppose u have ur solution opened in front of u , You will be able to see a references folder , right click , add reference . Click on the COM tab and there look for Capicom. select the same and then it will appear in the references folder in ur solution. Now in ur page add the line using Capicom. Is it ok now
Hello I didn't found anything in the com tag named Capicom i am using .net 2.0 ...sorry for the disturbance. alex.
-
Hello I didn't found anything in the com tag named Capicom i am using .net 2.0 ...sorry for the disturbance. alex.