Click here to Skip to main content
15,358,470 members
Home / Discussions / Mobile
   

Mobile

 
AnswerRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Hadrich Mohamed31-Dec-13 9:24
professionalHadrich Mohamed31-Dec-13 9:24 
GeneralRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Abdul Rahman Hamidy31-Dec-13 17:00
MemberAbdul Rahman Hamidy31-Dec-13 17:00 
GeneralRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Hadrich Mohamed1-Jan-14 1:21
professionalHadrich Mohamed1-Jan-14 1:21 
GeneralRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Abdul Rahman Hamidy11-Jan-14 20:23
MemberAbdul Rahman Hamidy11-Jan-14 20:23 
GeneralRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Hadrich Mohamed12-Jan-14 0:26
professionalHadrich Mohamed12-Jan-14 0:26 
QuestionGoogle map API key sample code bellow but it will display on error Pin
junnubabu.N27-Dec-13 16:39
Memberjunnubabu.N27-Dec-13 16:39 
QuestionHow to speed up the populating of listview + filter Android Pin
Member 947380925-Dec-13 20:23
MemberMember 947380925-Dec-13 20:23 
QuestionEncryption in Portable Classes Pin
Member 1047755319-Dec-13 8:46
MemberMember 1047755319-Dec-13 8:46 
I need to integrate basic encryption into a .Net portable class using PCLContrib (http://pclcontrib.codeplex.com/)

I have converted desktop framework code to portable as below but I get a padding error on decryption.
Can anybody help me out?:


VB
Public Function XAES_Encrypt(input As String, pass As String) As String
       Dim AES As New System.Security.Cryptography.AesManaged
       Dim Hash_AES As New System.Security.Cryptography.SHA256Managed
       Dim encrypted As String = ""
       Try
           Dim hash As Byte() = New Byte(31) {}
           Dim temp As Byte() = Hash_AES.ComputeHash(System.Text.UnicodeEncoding.Unicode.GetBytes(pass))
           Array.Copy(temp, 0, hash, 0, 16)
           Array.Copy(temp, 0, hash, 15, 16)
           AES.Key = hash
           ''''''''''''''''''AES.Mode = System.Security.Cryptography.CipherMode.ECB
           Dim DESEncrypter As System.Security.Cryptography.ICryptoTransform = AES.CreateEncryptor()
           Dim Buffer As Byte() = System.Text.UnicodeEncoding.Unicode.GetBytes(input)
           encrypted = Convert.ToBase64String(DESEncrypter.TransformFinalBlock(Buffer, 0, Buffer.Length))
           Return encrypted
       Catch ex As Exception
           Return ex.Message & "error"
       End Try
   End Function

   Public Function XAES_Decrypt(input As String, pass As String) As String

       Dim AES As New System.Security.Cryptography.AesManaged
       Dim Hash_AES As New System.Security.Cryptography.SHA256Managed
       Dim decrypted As String = ""
       Try
           Dim hash As Byte() = New Byte(31) {}
           Dim temp As Byte() = Hash_AES.ComputeHash(System.Text.UnicodeEncoding.Unicode.GetBytes(pass))
           Array.Copy(temp, 0, hash, 0, 16)
           Array.Copy(temp, 0, hash, 15, 16)
           AES.Key = hash
           '''''''''''''AES.Mode = System.Security.Cryptography.CipherMode.ECB
           Dim DESDecrypter As System.Security.Cryptography.ICryptoTransform = AES.CreateDecryptor()
           Dim Buffer As Byte() = Convert.FromBase64String(input)
           Dim TFB() As Byte = DESDecrypter.TransformFinalBlock(Buffer, 0, Buffer.Length)
           '''''''''''ERROR:Padding is invalid and cannot be removed.
           decrypted = System.Text.UnicodeEncoding.Unicode.GetString(TFB, 0, TFB.Length)

           Return decrypted
       Catch ex As Exception
           Return ex.Message & "Error"
       End Try
   End Function


modified 19-Dec-13 14:55pm.

Questionmaps Pin
junnubabu.N13-Dec-13 16:18
Memberjunnubabu.N13-Dec-13 16:18 
AnswerRe: maps Pin
Tom Marvolo Riddle30-Dec-13 2:24
professionalTom Marvolo Riddle30-Dec-13 2:24 
QuestionPush notifications to IsolatedStore Pin
Alex C. Duma10-Dec-13 20:29
MemberAlex C. Duma10-Dec-13 20:29 
QuestionCopying and Playing of an mp3 from a URL in Windows Phone 8 Pin
Vimalsoft(Pty) Ltd8-Nov-13 23:10
professionalVimalsoft(Pty) Ltd8-Nov-13 23:10 
SuggestionRe: Copying and Playing of an mp3 from a URL in Windows Phone 8 Pin
Richard MacCutchan8-Nov-13 23:41
mveRichard MacCutchan8-Nov-13 23:41 
GeneralRe: Copying and Playing of an mp3 from a URL in Windows Phone 8 Pin
Vimalsoft(Pty) Ltd8-Nov-13 23:45
professionalVimalsoft(Pty) Ltd8-Nov-13 23:45 
QuestionHow to Download the a Video,Audio, PDF, etc into a Local Storage Pin
Vimalsoft(Pty) Ltd8-Nov-13 20:55
professionalVimalsoft(Pty) Ltd8-Nov-13 20:55 
QuestionXML contents to Model in C# Windows Phone Pin
Vimalsoft(Pty) Ltd8-Nov-13 6:49
professionalVimalsoft(Pty) Ltd8-Nov-13 6:49 
AnswerRe: XML contents to Model in C# Windows Phone Pin
Vimalsoft(Pty) Ltd8-Nov-13 7:23
professionalVimalsoft(Pty) Ltd8-Nov-13 7:23 
QuestionAjax Navigation in Windows Phone 8 Pin
santhosh_init6-Nov-13 21:10
Membersanthosh_init6-Nov-13 21:10 
AnswerRe: Ajax Navigation in Windows Phone 8 Pin
Hadrich Mohamed31-Dec-13 9:15
professionalHadrich Mohamed31-Dec-13 9:15 
Questioneclipse Pin
Member 103849266-Nov-13 12:38
MemberMember 103849266-Nov-13 12:38 
AnswerRe: eclipse Pin
Richard MacCutchan6-Nov-13 23:02
mveRichard MacCutchan6-Nov-13 23:02 
QuestionLooking for cross platform development/framework feedback Pin
Joe Woodbury30-Oct-13 5:53
professionalJoe Woodbury30-Oct-13 5:53 
AnswerRe: Looking for cross platform development/framework feedback Pin
Jeremy Hutchinson30-Oct-13 7:05
professionalJeremy Hutchinson30-Oct-13 7:05 
AnswerRe: Looking for cross platform development/framework feedback Pin
A_WoodApple30-Oct-13 8:39
MemberA_WoodApple30-Oct-13 8:39 
GeneralRe: Looking for cross platform development/framework feedback Pin
Joe Woodbury1-Nov-13 6:50
professionalJoe Woodbury1-Nov-13 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.