Netcode 33 Veteran Poster

Hi All,
am trying to use build a secure login page. I have written necessary functions and the registrations works fine (with secure hash + salt passwords created) but the verification never goes through. Can someone point me in the right direction?

Imports System.Data
Imports System.Data.SqlClient
Imports System.Security.Cryptography
Imports System.Web.Security

Partial Class logon
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load

    End Sub

    Private Shared Function CreateSalt(size As Integer) As String
        ' Generate a cryptographic random number using the cryptographic
        ' service provider
        Dim rng As New RNGCryptoServiceProvider()
        Dim buff As Byte() = New Byte(size - 1) {}
        rng.GetBytes(buff)

   ' Return a Base64 string representation of the random number
        Return Convert.ToBase64String(buff)
    End Function

    Private Shared Function CreatePasswordHash(pwd As String, salt As String) As String
        Dim saltAndPwd As String = [String].Concat(pwd, salt)
        Dim hashedPwd As String = FormsAuthentication.HashPasswordForStoringInConfigFile(saltAndPwd, "SHA1")
        hashedPwd = [String].Concat(hashedPwd, salt)
        Return hashedPwd
    End Function
    Private Sub storeAccountDetails(userName As String,
                          passwordHash As String)

        Dim conn As SqlConnection = New SqlConnection("Server=(local);" + "Integrated Security=SSPI;" + "database=UserAccounts")
        Dim cmd As SqlCommand = New SqlCommand("RegisterUser", conn)
        cmd.CommandType = CommandType.StoredProcedure

        Dim sqlParam As SqlParameter = Nothing

        sqlParam = cmd.Parameters.Add("@userName", SqlDbType.VarChar, 20)
        sqlParam.Value = userName


        sqlParam = cmd.Parameters.Add("@passwordHash ", SqlDbType.VarChar, 50)
        sqlParam.Value = passwordHash

        Try

            conn.Open()
            cmd.ExecuteNonQuery()

        Catch ex As Exception

            ' Code to check for primary key violation (duplicate account name)
            ' or other database errors omitted for clarity
            Throw New Exception("Exception adding account. " + ex.Message)

        Finally

            conn.Close()
        End Try
    End Sub
    Protected Sub btnRegister_Click(sender As Object, …
Netcode 33 Veteran Poster

Am trying to write a c program to do the following;

• Write on the screen: ``Please enter a positive number: ''.
• Accept a number from the user.
• Keep prompting for more numbers until -1 is entered
• Output the sum of all entered numbers excluding -1.
• Output the integer part of the average of all entered numbers excluding -1.
• The program should properly check all input provided by the user and fail appropriately
if bad input is given. The user should not be able to induce a segmentation fault or
unintended behaviour from the program

I have written some code but the output seems wrong. here is my code below;

#include <stdio.h>
#include <stdlib.h>

#define LENGHT 10



int main(void) {

    int pnumbers[LENGHT] = {0};
    int i,j,k, sum = 0, input, count = 0, integers = 0;
    float check;

    i = 0;
    while (i < LENGHT) {
        i++;

        printf("Please enter a positive number:");

        scanf("%d", &input);

        if(input == -1) 
        { break;}


        if(input%2 == 0 || input%2 != 0) 
            pnumbers[i] = input;
        else
            break;

    }


    for(j = 0; j < LENGHT; j++) {
        sum = sum + pnumbers[j];
    }
    printf("\nSum = %d", sum);

    for(k = 0; k < LENGHT; k++) {

        if(pnumbers[k]%2 == 0 || pnumbers[k]%2 != 0) {
            count = count + 1;
            integers = integers + pnumbers[k];
        }
    }

    printf("\nAverage of integers = %d", integers/count);

    return 0;
}
Netcode 33 Veteran Poster

Thanks guys, though am trying to put things together. Got some more help from a friend and he talked about "unlink technique" Does that show up any where on the code?

Netcode 33 Veteran Poster

Thanks all for your contributions

Netcode 33 Veteran Poster
#include <stdlib.h>
    #include <string.h>
     int main(int argc, char *argv[]) {
     char *first, *second, *third;
     first = malloc(888);
     second = malloc(22);
     third = malloc(22);
     strcpy(first, argv[1]);
     strcpy(second, argv[2]);
     free(first);
     free(second);
     free(third);
     return(0);
     }

Like I said before, I need help learning C and trying to figure out my errors. With this code, am I vulnerable in terms of memory allocation? Could an attacker take advantage? If yes, please help me with your recommendations and guides

Thanks

Netcode 33 Veteran Poster

Hi all, trying to read up on C to get acquainted with the language. Got an exercise am trying to answer and i may need your help to know if am right. I have this code as below, and am asked, what lines have buffer length checking errors.

int main( void ) {
   char[20] in = gets();
   char[20] in2 = gets();
   char[39] out;
   strcpy(out,in);
   int index = strlen(in);
   while(index < 39) {
      out[index] = in2[index-strlen(in)];
      index = index + 1;
       }
       return 0;
     }

From my reading and research so far, line 5 seems to me like the line with an error. My reason is that it does not specify the length to be copied. ( in a lay man's english). I cant say for sure if am right but may need your help and also corrections on the code.

Thanks

Netcode 33 Veteran Poster

except there's some incentives to go with it. Like staying young (the vampire myth), being comfortable, never falling sick....and more

Netcode 33 Veteran Poster

You should use a database for your password rather than hardcoding. So if your app and there is need for a password change, you wont have to do some coding over again.

Netcode 33 Veteran Poster

You can start by adding references From project > Add Reference > Browse > Select dll File > Select desired components. Then you can add the controls to your toolbox

Netcode 33 Veteran Poster

Thanks alot. Got it!

Netcode 33 Veteran Poster

post some code on what you have done and you would get help if you have issues.

Netcode 33 Veteran Poster

To achieve not just the microsoft outlook interface but MS Office as you would have noticed Microsoft Office applications come with same looka and feel, you should learn more about "ribbons". You could get some help on the control here

Netcode 33 Veteran Poster

Gribouillis, thanks for your reply. However, if you read my very first statement just before the question at hand, you will know its likely you have added to my worries.

Netcode 33 Veteran Poster

I thought that startword and endword have to be four letter words?

yes, they are both four letter words and are words assumed to be in the list. If you take a good look at the list, all words there are four letter words.

Netcode 33 Veteran Poster

Am new to python and i need help dealing so i would go ahead and post the question and my little solution so far.

Question: a Procedure which takes four parameters as follows;
Dictionary File- the file name of a text file containing four letter words
Start Word- a four letter word (that you can assume is found in the Dictionary File file)
End Word- a four letter word (that you can assume is found in the Dictionary File file)
Result File- the file name of a text file that will contain the result
The result is the shortest list of four letter words, starting with StartWord, and ending with EndWord, with a number of intermediate words that are to be found in the DictionaryFilefile where each word differs from the previous word by precisely one letter.

So far, i've been able to return true or false if the searched strings exist. I used a list because i didnt wanna use a file so i loaded sample words into a list. See my code below but i wanna achieve the above.

# create list of words
dicfile = ["ante", "ants", "calf", "call", "calm", "clam", "diet", "dire", "earl", "edit",
        "emit", "erst", "fail", "fate", "feat", "feta", "ires", "irks", "item", "lair",
        "lame", "late", "leap", "les", "lets", "liar", "lips", "lira","list", "lite", 
        "male", "mall", "mate", "matt", "meal", "meat", "mint", "mite", "mitt", "naps",
        "neat", "nips", "nite", "nits", "opts", "pale", "pans", "past", "pate", "pats",
        "peal", "peat", "pest", "pets", "pier", "pins", "pits", …
Netcode 33 Veteran Poster

I saw "White house down" just last week.

Netcode 33 Veteran Poster

if life throws lemons at you, you make lemonades; and if it knocks you down on your knees, then its a perfect position to pray....Jut learn to risebeyondunctrollable situations

Netcode 33 Veteran Poster

i want to believe you have a form that saves this data into your database which only a particular user can edit what he/she entered. Also, i guess you already have a login form which is used to authenticate users and grant them access to your application. If so, then all you need do is write a little sub-procedure that saves the necessary login details anytime a user logs in. You can capture the username, time and date of login in that sub and call the sub whenever there's a successful login by a user. This way, the data is logged in its designated table.

Netcode 33 Veteran Poster

Rock songs all the way

Netcode 33 Veteran Poster

you an write and insert function that captures the username, time_of_login, Data_of_login of whoever logs in. This can then be called whenever any user sucessfully logs in so it automatically saves the data to its corresponding table.

You need to make more clarification on the editing part of your statement. Do you mean you want users to edit on what they entered or you want the editing to be done by other users because there seems to be a conflict between your statements in the first and second paragraph

Netcode 33 Veteran Poster

So far I have a table with category IDs, a seperate table for each category, a student list table, and a table to handle queries to the student list and category list.

In my opinion, having a table with just categoryIDs is needless. why not have
1. a table with two columns(categoryID and CategoryName)
2. a table with as many columns as the student data you want to capture(maybe StudentID, Name, Age,.......)
3. a table maybe named "Grade or Student_Progress" where you have the studentID, categoryID and then the level_of_comprehension.

this way, the Student_progression table is tied to the Table holding student data using the StudentID and is also tied to the Category Table using CategoryID

then, for storing the checkBox data, you would need to write some codes to do that which would depend on the DBMS you would be making use of.

For now, its a good start and we would love to help more as you proceed.

Netcode 33 Veteran Poster

movies definitely. i do write some codes if am in the mood.

Netcode 33 Veteran Poster

I use windows7 but i also have ubuntu running on same machine. Ubuntu is good but we cant still wipe away the good gracious usefulness of windows. Come to think of it, editing tools like photo and video editing, windows still has the best on its list. I would totally eradicate windows when applications like ADobe fireworks and photoshop start to run on the linux machine without any 3rd party software.
Developers i think(in my own opinion), are the most lovers of linux as it best fits their needs with little or no hitches especially when dealing with an opensource framework.

Netcode 33 Veteran Poster

If you were rightly understood, you want to create a login form using vb.net and MySql?

Netcode 33 Veteran Poster

could you post your codes on the 'save button' here so we could take a look at it

Netcode 33 Veteran Poster

what error message message do you get?

Netcode 33 Veteran Poster

You can also write this way. However, Pgmer's code should work

For Each Ctrl as Control in Me.controls
    if TypeOf(ctrl) is TextBox T
        ctrl.text = " "
    End If 
Next 

`

Netcode 33 Veteran Poster

declare all necessary variables like connectionstrings and commands
use the update statement below

'------------------------------------------
        UPDATE TableName
        SET columnName = ' + comboBox1.text + '
        WHERE columnName = 'value' AND ID = 'value'
'------------------------------------------
Netcode 33 Veteran Poster
Netcode 33 Veteran Poster

yeah! saving binary files to sql server ain't the problem here. the thing is, can't get to figure out where this binary files generated by the hardware is stored. if i could, then i could send it to sql server and retrieve it when needed. Done a lot of that already.
Thanks anyways

Netcode 33 Veteran Poster

textbox1.Text = ""

Netcode 33 Veteran Poster

Hi All,
am currently working on a biometrics application to capture the fingerprint of users. I am working with the DigitaPersonal (UareU 450) fingerprint reader. The app works fine at the moment but i need it to be more sophistciated by making it save the fingerprints in sqlserver database instead of keeping the binary files in memory as this causes data loss whenever the application is shut down.

I would greatly appreciate any help

Netcode 33 Veteran Poster

Its been a while away from Daniweb. love the new look, articles without replies now have bold red indicators. Good to be back

Netcode 33 Veteran Poster

Hello everyone
I've done a lot of searching over the internet on ways to retrieve system names and IP's of all devices connected to the same network as my computer. Windows has a way of doing this but don't know if its possible with linux and can't find any reasonable answer so far.

Thanks in advance for the response

Netcode 33 Veteran Poster

hericles has provided a perfect link but mind you that your connectionstring may not be the same as shown in the example. Please see here for more on connectionstrings

Netcode 33 Veteran Poster

Thanks Tony. But i would prefer resources i could use offline. i know the you-tube videos can be saved but it gives me even more issues to resolve as its not a compact resource watching from 5mins clip to clip. I need something more loaded and comprehensive

Netcode 33 Veteran Poster

Hello pythonistas,
am still some months new to python and i've decided to go with the web2py framework. I love its simplicity but unfortunately, it lacks study resources. The only available book i could get was the official book written by MASSIMO DI PIERRO. id be greatly appreciated if i could be provided with some helpful resources(books, videos, etc) or links to such resources.

Many Thanks

Netcode 33 Veteran Poster

The File is very much the same as the one from the python.org website and still have the same issues.

Did yours work when you tried?

Netcode 33 Veteran Poster

Hi everyone!
Am new to python, getting grounded in it as fast as i can but now, i have some issues. I use the web2py framework for web development. At the moment, am working on a blog using one of the CMS (named InstantPress) designed in web2py also.

While editing the blog, i needed to upload a new logo i created for the blog but i get an error written: "<type 'exceptions.ImportError'> Requires PIL installed in your system."

This clearly shows that i don't have Python Imaging Library (PIL) The problem now is this, i've installed the PIL but i still get same error, please could there be any other thing wrong and how can i know if my PIL is installed?

Here's a little info on my system to help my helpers:

operating system: Windows 7 64Bit
Interpreter: python 2.7.2 (Windows AMD64 / Intel 64 / X86-64 binary)
framework: web2py version 1.99.4 (stable)

Many Thanks

Netcode 33 Veteran Poster

Am listening to my inner mind.....my own thoughts

Netcode 33 Veteran Poster

You can use what i call in my own term, 'trackers'. Its a simple status identifier to me. SO maybe u can have another column in your table that checks the status of payment per student basis.... At least, that's a start for starters.

Netcode 33 Veteran Poster

Kanye West- All falls down

Netcode 33 Veteran Poster

Culture and tradition....two terrible setbacks in my part of the world. I bet you, you cant step into any government building with such looks. First, you may a suspected hoodlum or an irresponsible creature and you would never be taken seriously no matter how much idea you have or the best of solutions you offer in your proposals. same in private sector companies. Besides, if you owned a company yourself, would you like to see your representative appear on National/International TV with all of that? I guess it would send the wrong signal about your firm to the public

Netcode 33 Veteran Poster

I got the same message from the same guy but i checked his status and it says 'banned' so i know its under control.

Netcode 33 Veteran Poster

You most need the .ico and the link provided by waqasaslammmeo should help.

Netcode 33 Veteran Poster

welcome!

Netcode 33 Veteran Poster

welcome!

Netcode 33 Veteran Poster

Another advice: you may want to design a blog and publish news on different fields as may come to your mind or consider a forum also. Its more viable than designing a social network.....The time ain't ripe.

Netcode 33 Veteran Poster

You absolutely have to watch this: http://www.youtube.com/watch?v=abORgnI0NIw

Funny!

Netcode 33 Veteran Poster

Nearly all men can stand adversity,
but if you want to test a mans character,
give him power.”
~ Abraham Lincoln
(1809-1865)