2025-03-09

Password Generator

Password Generator - program for building lists of random passwords.  Length and complexity is controlled by options.  Final results are written to an ASCII file.

This is a free Keyliner download that is a stand-alone executable.  No installation or configuration is required.  This program does not require registration, nor are there ads or nagware. Free to use for personal and commercial use.  Tested on Windows 7 through 11. 



For a company's public wireless access, we needed a way to generate passwords with a one-week life-span, starting Monday morning through the next Sunday night.  



This program generates several year's worth of weekly passwords, writing results to a tab-delimited file. 




When run, it writes a simple tab-delimited text file, editable with Notepad or Excel.  In the three columns are that week's password, the starting date and an ending date.  If you only need passwords, check the option [x] Passwords Only, or simply ignore the dates.

Installation:

There is none.  Download, expand the ZIP, and run.
No spying, no adware, no registration, no logins, no kidding.

This is a self-contained .exe that does not need installation, registry changes, or configuration files.  Place the .exe, and its related files, in any directory.  Double-click to run.

Since keyliner cannot afford a signing certificate, you will be prompted the file is not safe (being downloaded from the internet).  Click "more information" and allow the program to run or see below for better instructions.


Follow these steps for a more professional installation:

This program should be copied to ProgramFiles so it gains the protection of other Windows security features. Total time: about a minute.

A.  Download the .ZIP to a Download or Temp folder:

From Keyliner's public GDrive, click this link and download to a local temp or download directory.  Do not download directly into ProgramFiles

Download ZIP link
Public GDrive Download Link:  PasswordGenerator.zip

Direct link: https://drive.google.com/file/d/1P7vx-Zy8cgBeBMH2fOBhVn-OcrCH5BME/view?usp=drive_link

MD5:  c7-47-fc-51-ac-6b-65-c5-31-2f-e1-db-cf-95-af-0e
SHA256: 324fdede08e6b645e09f58d84e2185ee79fc33184d859ce665596dbcaf13cabe

When downloading, different browsers behave differently.
You may be prompted the file cannot be scanned.  Click "Download anyway"

B.  Mark the ZIP as safe-to-run:

(This step may not be needed if downloaded by Edge and you clicked "More / Download Anyway")

Using File Explorer, right-mouse-click the downloaded .zip
Select "Properties"
Check [x] Unblock.  This removes the "mark of the web." 

                 Click for larger view

* Only do this if you trust keyliner *and* only if downloaded from keyliner's public GDrive.  When unblocking the .zip, it also unblocks each file within the zip -- an important thought.

If "Unblock" is not visible, it has already been unlocked (by Microsoft Edge).
Once [x] Unblocked is clicked, this security menu disappears.


C.  Create a Program folder to hold the program:

Using File Explorer, open folder C:\Program Files,
Create a folder  C:\Program Files\Util


D.  Separately, Copy the .exe and two other support files to ProgramFiles\Util:

Using File Explorer,
Double-click to open the downloaded .ZIP

Copy and paste these three files from the download folder 
to C:\Program Files\Util

PasswordGenerator.exe 
PasswordGenerator.dll 
PasswordGenerator.runtimeconfig.json 
 
 
Do this copy as a two-step, copying from the download folder into Program Files.  Windows security will not let you download directly into Program Files (technically, you will not be able to remove the "mark of the web" if downloaded directly into Program Files).


E.  Create a Start Menu icon:

Using File Explorer, in C:\Program Files\Util
Right-mouse-click "PasswordGenerator.exe" and "Pin to Start"
 
The program is ready to run.  See icon on Start Menu.


Use:

1.  Launch the program.




2.  Choose a password strength.

     Default = "High" 
     (12-character passphrase, Caps, digits, likely multi-word, depending on length)

     For documentation:
  Lowest  = 8 Char,  Capitals, No numbers
  Low     = 8 Char,  Capitals, Numbers
  Med     = 10 Char, Capitals, Numbers 
  High    = 12 Char, Capitals, Numbers, likely multi-word
  Higher  = 14 Char, Capitals, Numbers, multi-word
  Highest = 16 Char, Capitals, Numbers, multi-word

     Optionally select "[x] Require special characters"      

3.  Set the Count for how many passwords to generate.
     100 is two year's worth of weekly passwords.

4.  Type an output file path and filename or accept the default:
     "C:\Temp\VisitorPassword.csv"

5.  Pick a Start Date (any Date) or ignore if not important.
     Set the Cycle Date; which defaults to a 7-day password rotation.

6.  Click Generate.

7.  Click the Notepad icon to view the resulting file.  Example results:


The generated list has passwords and dates.
To generate the file without the dates, choose [x] Password Only, no dates


Randomization Notes:

The intent is to generate multiple, random passwords (passphrases), but over the course of several hundred runs, it may assemble the same phrase.  This is okay.  Theoretically, you are assigning the phrase to different users or across wide time spans.

To help block dictionary attacks, at strengths "Higher" and above, the program generates multi-word phrases. 

Password lengths are guaranteed to be the minimum length indicated, but are often longer, with variations in lengths.  For example, a "High" password will be a minimum of 12 characters, but will randomly generate longer, 12 to (16) characters.  This makes passwords less predictable.

When generating single passwords, press ctrl-C to copy the password to the clipboard.


Drop me a note on how you used the program.  I welcome suggestions.

Humor:  Earlier versions of this program generated these passwords:  "FriskyHamster27".  Management called.  Program modified.  I am still fond of FriskyHamster.

2025.03 Updates:
Recompiled using .dotNet 8.0 libraries
Added several hundred-word randomizations
Added "password only" option
Added clipboard capabilities
Added Set Sunday/Monday start dates

-----------------------
For an interesting discussion on passwords and for the reasons for this program's design, see this keyliner article:  Link:  "Better Safer and Stronger Passwords"


Download link
Public GDrive Download Link:  PasswordGenerator.zip

Related articles:
keyliner link:  Better Safer and Stronger Passwords
keyliner link:  Calculate MD5 Checksums





2025-02-02

PaintShop Pro - Using a masking layer to change colors

 PaintShop Pro - Using a masking layer to change colors.  For this example, change a person's eye color.


Goal:
Change an eye-color using PSP's Mask feature.
In the photograph, anything's color can be changed with this technique.  For example, a bridge or a river
.

This can be better than PSP's "Color Changing Tool".  Instead of "repainting", this adjusts the hue and saturation, without losing details in the object

I found an AI-generated instructional video on YouTube documenting these steps but the video was unusable.  Here are the steps in a more digestible format.  AI-generated person's Eye-model pilfered from that video.

Using PaintShop Pro 2023
These steps should work with any version and these rough steps will probably work in any photo editor.

Steps:

1.  In the layers pallet, duplicate the background layer
 
Right-mouse-click the layer, select "Duplicate"
Right-click the new layer's name, changing its name to something like "myMaskedLayer"

2.  Highlight the new (duplicated) layer

In the Layers pallet, along the bottom row of icons, click the Mask icon
Choose "Show All"

A new group forms
Note the new White Mask sublayer

3. Add an "HSL" Adjustment Layer

In the new Mask Group, select the inner full-color photograph (illustrated below, in Blue)
(For now, ignore the white Mask layer)

On the bottom, click the Layer's "Adjustment Layer" icon (bottom of pallet)
Select menu "Hue/Saturation/Lightness" (HSL)

4.  An HSL popup appears

A new gray-scale image displays
Check [x] Colorize

Note:  All sliders move to zero
Click OK

5.  Select the White Mask Layer


In the Color Pallet's menu:
- Set the Fore-Color to Black (click the black/white diagonal button)
- Set the Back-Color to White

6.  Paint the eyes

While still on the "White" layer

Select the PaintBrush tool
Set Hardness = 0
Opacity = 100
Size = (Any comfortable, but smaller brush size)

7.  On the gray-scale "white" layer, paint the eyes with a relatively small brush. 

- Use the mouse's roller-wheel to zoom
- Zoom in 1000% is common

You are essentially painting the eyes with a black brush, but since this is on the colorized masked layer; the background color bleeds through


When done, note the white-layer's eyes, showing as two dark eyes on a snowy-white background:

8.  Invert the layer

While still highlighting the "white" layer
Select top-menu:  Layers, "Invert/Mask Adjustment"

The photo returns to normal colors
(The "white" layer, with its two little eyes is now a "black" layer with two white eyes (not illustrated))

9.  Select the HSL layer

Right-click, "Properties"
Adjust the slider-bars until happy with new eye colors

At the group's level, toggle the layer's "Visibility" icon off/and on to see the effect:

10.  Optional: Adjust the effect's lightness

While highlighting the HSL Layer
Select the Pallet's bottom button "New Adjustment Layer"
Choose "Curves" from the sub-menu (not illustrated)

Slide ("scootch") the two sliders inland a "smidge"

Final results:

-end

2025-01-31

Powershell - ParseExact with 3 argument(s): String was not recognized as a valid DateTime

Powershell Code - ParseExact Date Conversion - String not recognized as valid DateTime


Windows Powershell

Goal:  Read and validate a string-date (with a known and expected format). 
Guarding against February 31st and stuff like that

Technique:
Cast the string into a [datetime].
Use ParseExact to convert the date
Use try-catch to detect detect failures.

Code:

[DateTime]$dtconvertedDate           #Declare DateTime Variable
[string]$strmyDate = "01/01/2025"    #Variable to test

try
{
   # Cast the ParseExact as [dateTime]

   # Unsafe
   $dtconvertedDate = [datetime]::ParseExact($strmyDate, "MM/dd/yyyy", $null)

   # Safer
   $dtconvertedDate = [datetime]::ParseExact($strmyDate.Trim(), "M/d/yyyy", $null)
}
catch
{
   # not illustrated -- not a date
}

Possible errors:
Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."

Possible answers:
-  $strmyDate  is from an Excel-exported CSV or tab file.   Be sure to .Trim().  Unsafe otherwise.

-  Mask  "MM/dd/yyyy" is case-sensitive!

-  Mask "MM/dd/yyyy"  can be, but is not always safe. 
    Date strings with leading zeros vs not:  "1/17/2025" -- MM/dd will fail.
    Use "M/d/yyyy"

-  Mask in wrong format:  MM-dd-yyyy  vs MM/dd/yyyy
    hyphens vs slash.  ParseExact with a mask cares.