Click here to Skip to main content
15,885,546 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: Flash Banner in Mobile Pin
Sunasara Imdadhusen23-May-14 0:20
professionalSunasara Imdadhusen23-May-14 0:20 
QuestionWindow mobile development Pin
ravikhoda3-Feb-14 19:12
professionalravikhoda3-Feb-14 19:12 
AnswerRe: Window mobile development Pin
thatraja3-Feb-14 20:18
professionalthatraja3-Feb-14 20:18 
GeneralRe: Window mobile development Pin
ravikhoda3-Feb-14 20:20
professionalravikhoda3-Feb-14 20:20 
GeneralRe: Window mobile development Pin
Sunasara Imdadhusen26-Apr-14 0:56
professionalSunasara Imdadhusen26-Apr-14 0:56 
QuestionHow to merge mp3 files into one in windows phone 8 Pin
Abdul Rahman Hamidy3-Feb-14 4:28
Abdul Rahman Hamidy3-Feb-14 4:28 
QuestionHow to add pivot item to wp8 Pin
Abdul Rahman Hamidy28-Jan-14 20:10
Abdul Rahman Hamidy28-Jan-14 20:10 
QuestionHow to draw a straight line 3 cm?( windows phone) Pin
chinakknd11-Jan-14 14:39
chinakknd11-Jan-14 14:39 
AnswerRe: How to draw a straight line 3 cm?( windows phone) Pin
Richard MacCutchan11-Jan-14 22:17
mveRichard MacCutchan11-Jan-14 22:17 
QuestionTextBlock does not display all Text (Windows Phone 8) Pin
Abdul Rahman Hamidy3-Jan-14 19:12
Abdul Rahman Hamidy3-Jan-14 19:12 
AnswerRe: TextBlock does not display all Text (Windows Phone 8) Pin
PavanPareta9-Jan-14 19:29
PavanPareta9-Jan-14 19:29 
Questionsystem.data version conflict? Pin
murali_utr3-Jan-14 3:46
murali_utr3-Jan-14 3:46 
Questionnot enough space on disk Pin
murali_utr3-Jan-14 3:43
murali_utr3-Jan-14 3:43 
QuestionRemoving Delay in Playing Mp3 Files in Windows Phone 8 Pin
Abdul Rahman Hamidy30-Dec-13 0:35
Abdul Rahman Hamidy30-Dec-13 0:35 
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
Abdul 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
Abdul 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
junnubabu.N27-Dec-13 16:39 
QuestionHow to speed up the populating of listview + filter Android Pin
Member 947380925-Dec-13 20:23
Member 947380925-Dec-13 20:23 
QuestionEncryption in Portable Classes Pin
Member 1047755319-Dec-13 8:46
Member 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
junnubabu.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
Alex C. Duma10-Dec-13 20:29 

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.