Rafa 1850 0 Denunciar post Postado Outubro 6, 2009 Olá galera! bem, estou em um sistema de login aonde necessito por uma criptografia para senha eu já fiz tudo rodar mas... a parte da criptografia eu, simplesmente, não consigo entender o código. famoso copy / past e adequei ao meu sistema. está funcionando e pra galera q precisa fazer o mesmo, 'enjoy'! alguém pode só me explicar as palavras em negrito? eis minha função de criptografia: Public Function criptografar(ByVal Texto As String) As String Dim i As Integer = 0 Dim strTempChar As String = " " For i = 1 To Len(txtsenha.Text) If [b]Asc(Mid$([/b]txtsenha.Text, i, 1)) < 128 Then strTempChar = [b]Asc(Mid$([/b]txtsenha.Text, i, 1)) [b]+ 128[/b] ElseIf [b]Asc(Mid$[/b](txtsenha.Text, i, 1)) > [b]128[/b] Then strTempChar = A[b]sc(Mid$[/b](txtsenha.Text, i, 1)) [b]- 128[/b] End If [b]Mid$[/b](txtsenha.Text, i, 1) = [b]Chr(strTempChar)[/b] Next i criptografar = Texto End Function um grande abraço! Compartilhar este post Link para o post Compartilhar em outros sites
gabrieldb 5 Denunciar post Postado Outubro 6, 2009 Acho que você deve postar essa dúvida no forum de .NET já que você está usando o VB.NET lá será mais fácil eles te ajudarem. Compartilhar este post Link para o post Compartilhar em outros sites
quintelab 91 Denunciar post Postado Outubro 6, 2009 Movido Visual Basic http://forum.imasters.com.br/public/style_emoticons/default/seta.gif Plataforma .NET > Windows Applications Você mesmo fez sua função de criptografia, copiou de algum artigo? Abraços... Compartilhar este post Link para o post Compartilhar em outros sites
Rafa 1850 0 Denunciar post Postado Outubro 6, 2009 Movido Visual Basic http://forum.imasters.com.br/public/style_emoticons/default/seta.gif Plataforma .NET > Windows Applications Você mesmo fez sua função de criptografia, copiou de algum artigo? Abraços... sim sim peguei no artigo do marcoratti.. esqueci de falar =D http://www.macoratti.net/dica32.htm eu não entendi algumas partes do código. abraços, alguem q saiba da um help ae.. ^^ me explicar as palavras em negrito q o help do VS nao tem, x_x If Asc(Mid$(txtsenha.Text, i, 1)) < 128 Then strTempChar = Asc(Mid$(txtsenha.Text, i, 1)) + 128 ElseIf Asc(Mid$(txtsenha.Text, i, 1)) > 128 Then strTempChar = Asc(Mid$(txtsenha.Text, i, 1)) - 128 End If Mid$(txtsenha.Text, i, 1) = Chr(strTempChar) [] o meu chefe disse q termos como Asc são antigos... ele quiz q eu pensasse em um método de CRIAR uma criptografia, uma função que faça alguma coisa... e criptografe um txt. eu consigo implementar esta função no meu sistema , mas nao faço idéia de como criar uma função de criptografia. acho q seria importante eu entender essas palavras pra minha lógica começar a falar =* se alguem tiver um tuto ou artigo sobre criação de funções q façam criptografias simples.. para aprender a criar a função, o mais basico possivel... abraços, Rafa. Compartilhar este post Link para o post Compartilhar em outros sites
quintelab 91 Denunciar post Postado Outubro 6, 2009 Se você quiser criar uma função de criptografia é melhor ir em Lógica de Programação. Montar a idéia primeiro. Abraços... Compartilhar este post Link para o post Compartilhar em outros sites
Rafa 1850 0 Denunciar post Postado Outubro 7, 2009 vlw. eu só queria entender essas palavras do codigo. logica de criptografia, em pseudo codigo, eu entendo... mas entendi +/- jah abraços e grato [] Compartilhar este post Link para o post Compartilhar em outros sites
nexus 0 Denunciar post Postado Outubro 7, 2009 Seguinte, se você for no Object Browser do VS e pesquisar por estes termos você vai encontrar.. mas como sou um cara legal, vou colocar aki para você :) Public Function Asc(ByVal String As Char) As Integer Member of: Microsoft.VisualBasic.Strings Summary: Returns an Integer value representing the character code corresponding to a character. Parameters: String: Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an System.ArgumentException error occurs. Return Values: Returns an Integer value representing the character code corresponding to a character. Public Function Mid(ByVal str As String, ByVal Start As Integer, ByVal Length As Integer) As String Member of: Microsoft.VisualBasic.Strings Summary: Returns a string containing a specified number of characters from a string. Parameters: Start: Required. Integer expression. Starting position of the characters to return. If Start is greater than the number of characters in str, the Mid function returns a zero-length string (""). Start is one based. str: Required. String expression from which characters are returned. Length: Optional. Integer expression. Number of characters to return. If omitted or if there are fewer than Length characters in the text (including the character at position Start), all characters from the start position to the end of the string are returned. Return Values: Returns a string containing a specified number of characters from a string. Public Function Chr(ByVal CharCode As Integer) As Char Member of: Microsoft.VisualBasic.Strings Summary: Returns the character associated with the specified character code. Parameters: CharCode: Required. An Integer expression representing the code point, or character code, for the character. If CharCode is outside the valid range, an System.ArgumentException error occurs. The valid range for Chr is 0 through 255, and the valid range for ChrW is -32768 through 65535. Return Values: Returns the character associated with the specified character code. okzzzz.. resumindo.. ASC -> retorna o codigo integer do char que passou como parametro MID -> retorna uma parte especifica da string CHR -> retorna o CHAR respectivo do Integer que passou como parametro. Compartilhar este post Link para o post Compartilhar em outros sites
Rafa 1850 0 Denunciar post Postado Outubro 13, 2009 agradeço mto! rsrsrs abraços! na proxima eu uso o Object Browser do VS experiencia++ abcs Compartilhar este post Link para o post Compartilhar em outros sites