Jump to content

Visual Studio 2015 Password Generator

Joemoma

Hey everyone, I'm very new to the world of coding but i've been really interested in creating a Random password Generator that i can put on my USB. But i've been seeing an oddity where my code examples are not matching those in videos i've been watching (*yes they were same program and everything) i would follow their instructions and my code parameters are different

 

Their Code would say: 

 

Private Sub blahblahblahl

 

 My code is labeled:

 

Private Void blahblahblah

 

and anytime i try to copy paste pre-written code it is just full of errors.. so, any suggestions to whats up? or even where i should start with my new coding interest?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

i'm assuming you're using namespace standard?

We can't Benchmark like we used to, but we have our ways. One trick is to shove more GPUs in your computer. Like the time I needed to NV-Link, because I needed a higher HeavenBench score, so I did an SLI, which is what they called NV-Link back in the day. So, I decided to put two GPUs in my computer, which was the style at the time. Now, to add another GPU to your computer, costs a new PSU. Now in those days PSUs said OCZ on them, "Gimme 750W OCZs for an SLI" you'd say. Now where were we? Oh yeah, the important thing was that I had two GPUs in my rig, which was the style at the time! They didn't have RGB PSUs at the time, because of the war. The only thing you could get was those big green ones. 

Link to comment
Share on other sites

Link to post
Share on other sites

@VioDuskar yes

 

using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
 
        }
    }
}
 
So i opened VS > New Project > Selected Windows Forms Application  and it by Defaults uses the "private void" instead of the "private sub" like i see in all the other videos
Link to comment
Share on other sites

Link to post
Share on other sites

 

So i opened VS > New Project > Selected Windows Forms Application  and it by Defaults uses the "private void" instead of the "private sub" like i see in all the other videos

 

"sub" is a VB thing, you are using C#

Link to comment
Share on other sites

Link to post
Share on other sites

"sub" is a VB thing, you are using C#

Dam, alright. i'll try that real quick

 

Edit: .... i think i love you.. hahah. i literally just got into this 2 days ago. so i never caught that mistake =))  thank ya sir.  .... Now to try to get something working lol

Link to comment
Share on other sites

Link to post
Share on other sites

If you're going to use this for anything that needs to be secure, then you'll need to use a cryptographically strong random number generator. It's highly recommended that you avoid using your own implementation as it's very unlikely to be secure. The RNGCryptoServiceProvider class is one option supplied by the .NET framework.

 

If you don't need it to be secure, then you can pretty much go with anything, even your own creation. The Random class is provided by the .NET framework.

Link to comment
Share on other sites

Link to post
Share on other sites

If you're going to use this for anything that needs to be secure, then you'll need to use a cryptographically strong random number generator. It's highly recommended that you avoid using your own implementation as it's very unlikely to be secure. The RNGCryptoServiceProvider class is one option supplied by the .NET framework.

 

If you don't need it to be secure, then you can pretty much go with anything, even your own creation. The Random class is provided by the .NET framework.

Yes i was not planning on actually using it for anything YET, i'm mainly using this as a learning experience

Link to comment
Share on other sites

Link to post
Share on other sites

Dam, alright. i'll try that real quick

 

Edit: .... i think i love you.. hahah. i literally just got into this 2 days ago. so i never caught that mistake =))  thank ya sir.  .... Now to try to get something working lol

No problem, if you need anything else just ask :)

Link to comment
Share on other sites

Link to post
Share on other sites

No problem, if you need anything else just ask :)

well my next implementation would be to have it follow a certain pattern but have that pattern be random.  kind of like:   Number, Letter, Number, Letter.   but have each of those be a random number and random letter.  i know that it consists of creating a String = "ABCDEFG"... etc. but thats about as much as i know. like i said, i just picked this up this week and trying to do self taught a little

Link to comment
Share on other sites

Link to post
Share on other sites

You know there's Membership.GeneratePassword right?

using System;using System.Web.Security;namespace ConsoleApplication1{    class Program    {        static void Main(string[] args)        {            var rnd = new Random();            for (var i = 0; i < 5; i++)            {                                Console.WriteLine(Membership.GeneratePassword(rnd.Next(5, 30), rnd.Next(0, 5)));            }            Console.ReadKey();        }    }}

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

 

You know there's Membership.GeneratePassword right?

using System;using System.Web.Security;namespace ConsoleApplication1{    class Program    {        static void Main(string[] args)        {            var rnd = new Random();            for (var i = 0; i < 5; i++)            {                                Console.WriteLine(Membership.GeneratePassword(rnd.Next(5, 30), rnd.Next(0, 5)));            }            Console.ReadKey();        }    }}

 

 

I've actually never used that before what does the output look like? (In the middle of a csgo game can't look myself)

Link to comment
Share on other sites

Link to post
Share on other sites

I've actually never used that before what does the output look like? (In the middle of a csgo game can't look myself)

 

It looks like random garbage  :D

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

@Nater alright i got it set up using a Mask, and using String Values. so more or less:

 

Private Const assorted As String = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*[]{}()-=_+"

 

If (Mask© = "@") Then
                Output.Append(Random.Next(0, 9))                                                                          'Replace all @ symbols with a random number from 0 to 9
            ElseIf (Mask© = "$") Then
 
                Output.Append(UpperCaseKeys(Random.Next(0, UpperCaseKeys.Length())))      'Replace all $ symbols with a random uppercase letter
            ElseIf (Mask© = "#") Then
 
                Output.Append(LowerCaseKeys(Random.Next(0, LowerCaseKeys.Length())))     'Replace all # symbols with a random lowercase letter
            ElseIf (Mask© = "!") Then
 
                Output.Append(assorted(Random.Next(0, LowerCaseKeys.Length())))
            Else
 
                Output.Append(Mask©)                                                                                         'If there isn't a @, $ or # then keep the original character
            End If
Next
        Return Output.ToString 'return the output
    End Function
 
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        str = (GenMask("@$$@@")) 'Make a string with the input mask (red) and put it in the str variable
        TextBox1.Text = str 'show the string in the textbox
 
        str = (GenMask("!!!!-!!!!-!!!!-!!!!"))
        TextBox2.Text = str
    End Sub
 
 
So while exploring this subject... i kinda got interested in Keygens... specifically for Malwarebytes (because i use it).  would anyone happen to know the specific pattern for the Key?  i know the ID is  #LL##, i tried just using the fully randomized string for the Key but nothing stuck.  
Link to comment
Share on other sites

Link to post
Share on other sites

So while exploring this subject... i kinda got interested in Keygens... specifically for Malwarebytes (because i use it).  would anyone happen to know the specific pattern for the Key?  i know the ID is  #LL##, i tried just using the fully randomized string for the Key but nothing stuck.  

 

Keygen are more complex than "generate some random key until it works", you can do a quick google search on how they work but you'll need some ASM knowledge, also it's not something that we are allowed to discuss, it's agains the CoC.

Link to comment
Share on other sites

Link to post
Share on other sites

Keygen are more complex than "generate some random key until it works", you can do a quick google search on how they work but you'll need some ASM knowledge, also it's not something that we are allowed to discuss, it's agains the CoC.

Ah, yea wasnt too sure about the "legality" of talking about it on the forums. thanks for all the help though =))

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×