Click here to Skip to main content
16,015,991 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhow to filter data Pin
areon2522-Jun-06 14:01
areon2522-Jun-06 14:01 
AnswerRe: how to filter data Pin
Mekong River22-Jun-06 15:33
Mekong River22-Jun-06 15:33 
Questionhow to edit the database.. Pin
areon2522-Jun-06 13:58
areon2522-Jun-06 13:58 
AnswerRe: how to edit the database.. Pin
Mekong River22-Jun-06 15:36
Mekong River22-Jun-06 15:36 
Questionsending data from VB to another open program Pin
maxious2222-Jun-06 5:19
maxious2222-Jun-06 5:19 
AnswerRe: sending data from VB to another open program Pin
MarchJ30-Jun-06 12:21
MarchJ30-Jun-06 12:21 
QuestionSecuring a SQL Connection string [modified] Pin
Marcus J. Smith22-Jun-06 3:57
professionalMarcus J. Smith22-Jun-06 3:57 
AnswerRe: Securing a SQL Connection string Pin
mikanu22-Jun-06 5:42
mikanu22-Jun-06 5:42 
As I'm sure you know, there is no such thing as perfect security. In most cases all you need to do is figure out your target audience and what level of security will sufice for your purposes. It usually take to figure out something that will keep *most* hackers out.

This is a first and simple step you could take to further secure your connection strings. Encrypt them and instead of storing the key as a string in your code, obfuscate it a little bit. I'm going to give you a simple example of what that means but you can derive and go nuts with it.

let's say you have the following key "mypass123".

Dim i As Integer          ' A counter
Dim str(9) As Byte        ' This array will store the ASCII codes of the characters in the key

Dim keyLength As Integer  ' This will store the keyLength
Dim keyString As String   ' Variable used to store the key at the end, as a string

str(0) = 109              ' ASCII code for "m"
str(1) = 121              ' ASCII code for "y"
str(2) = 112              ' ASCII code for "p"
str(3) = 97               ' ASCII code for "a"
str(4) = 115              ' ASCII code for "s"
str(5) = 115              ' ASCII code for "s"
str(6) = 49               ' ASCII code for "1"
str(7) = 50               ' ASCII code for "2"
str(8) = 51               ' ASCII code for "3"
keyLength = 9             ' manually specify the length of the key

' Load keyString with the key, by appending the characters of the key
keyString = ""
For i = 0 To keyLength - 1
    keyString = keyString + Chr(str(i))
Next i

' Now you can use keyString as the key to unlock your connection string


obviously you can improve the method of obfuscation even further. Here's an example:

str(0) = 109              ' ASCII code for "m"
str(1) = str(0) + 12      ' ASCII code for "y"
str(2) = str(1) - 9       ' ASCII code for "p"
str(3) = str(2) - 15      ' ASCII code for "a"
str(4) = str(2) + 3       ' ASCII code for "s"
str(5) = str(4)           ' ASCII code for "s"
str(6) = 49               ' ASCII code for "1"
str(7) = str(6) + 1       ' ASCII code for "2"
str(8) = str(7) + 1       ' ASCII code for "3"


----
www.digitalGetto.com
GeneralRe: Securing a SQL Connection string Pin
Marcus J. Smith22-Jun-06 7:35
professionalMarcus J. Smith22-Jun-06 7:35 
QuestionHTTPPost passing in username and password Pin
J Liang22-Jun-06 3:39
J Liang22-Jun-06 3:39 
QuestionFree Refactor! for VB Pin
Kevin McFarlane22-Jun-06 3:16
Kevin McFarlane22-Jun-06 3:16 
Questionproblem playing .wmv files Pin
seva0412197322-Jun-06 1:54
seva0412197322-Jun-06 1:54 
Questionconfig File Pin
Piwe22-Jun-06 0:29
Piwe22-Jun-06 0:29 
AnswerRe: config File Pin
Socheat.Net23-Jun-06 17:26
Socheat.Net23-Jun-06 17:26 
QuestionCancel command Pin
angelagke21-Jun-06 23:22
angelagke21-Jun-06 23:22 
AnswerRe: Cancel command Pin
Dave Kreskowiak22-Jun-06 8:17
mveDave Kreskowiak22-Jun-06 8:17 
QuestionHow to know if the image is valid Pin
mysterious3rd21-Jun-06 22:22
mysterious3rd21-Jun-06 22:22 
AnswerRe: How to know if the image is valid Pin
mikanu22-Jun-06 5:48
mikanu22-Jun-06 5:48 
QuestionMAPI Pin
eKuzu21-Jun-06 21:58
eKuzu21-Jun-06 21:58 
Questionread a wav file and write buffer into anothet wav file Pin
sihotamarpal21-Jun-06 20:54
sihotamarpal21-Jun-06 20:54 
QuestionRunning VB Application from CD Pin
abhaysurve21-Jun-06 20:36
abhaysurve21-Jun-06 20:36 
AnswerRe: Running VB Application from CD Pin
Dave Kreskowiak22-Jun-06 1:23
mveDave Kreskowiak22-Jun-06 1:23 
QuestionWindows service Pin
Rsekaran21-Jun-06 19:08
Rsekaran21-Jun-06 19:08 
Questionoop Pin
md_refay21-Jun-06 12:06
md_refay21-Jun-06 12:06 
AnswerRe: oop Pin
mr_1234521-Jun-06 12:14
mr_1234521-Jun-06 12:14 

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.