diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8c5d07d --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Build artifacts +meowpass +meowpass_production.swift +meowpass_combined.swift +embedded_production.swift + +# Temporary files +*.swp +*.swo +*~ +.DS_Store diff --git a/README.md b/README.md index f28adc4..b63f0be 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # MeowPassword -A command-line utility that generates secure, phrase-based passwords using cat names and Kolmogorov complexity analysis with a lolcat theme. +A command-line utility that generates secure, phrase-based passwords using cat names and Kolmogorov complexity analysis with a delightful cat theme. ## Features +- **🎨 Random ASCII Art Cats** - Displays a different adorable cat on each run for a delightful experience - **1000+ Embedded Cat Names** - No external file dependencies - **Secure Password Generation** - Creates passwords from 3-5 cat names with configurable length (15-50 characters) - **Advanced Security Transformations**: @@ -12,7 +13,7 @@ A command-line utility that generates secure, phrase-based passwords using cat n - Configurable symbols replacing letters (1-10, default: 2) - Removes repeating letters with random digits - **Kolmogorov Complexity Analysis** - Evaluates and selects the most secure password from 5 candidates -- **Lolcat Theme** - ASCII art and professional interface without emojis +- **Modern CLI Arguments** - Support for both long (`--option`) and short (`-o`) option formats - **Configurable Parameters** - Control numbers, symbols, and maximum length - **Clipboard Support** - Copy to clipboard (macOS only) - **Self-Contained Executable** - Single binary with embedded data @@ -44,43 +45,123 @@ meowpass ## Usage -### Generate Password +### Generate Password (Default Settings) ```bash meowpass ``` +Each run displays a random ASCII art cat! The program will: +1. Show a random cat ASCII art (6 different cats available) +2. Generate 5 password candidates using cat names +3. Analyze each candidate's security using Kolmogorov complexity +4. Select and display the most secure password + ### Generate with Custom Parameters + +Using long options: ```bash meowpass --numbers 4 --symbols 3 --max-length 30 ``` +Using short options: +```bash +meowpass -n 4 -s 3 -m 35 +``` + +Mix and match: +```bash +meowpass -n 5 --symbols 4 -m 40 +``` + ### Run Tests ```bash meowpass --test +# or +meowpass -t ``` ### Copy to Clipboard (macOS) ```bash meowpass --copy +# or +meowpass -c ``` ### Show Help ```bash meowpass --help +# or +meowpass -h ``` +## ASCII Art Feature +MeowPassword includes 6 different ASCII art cats that are randomly displayed each time you run the program: +- 🎨 Original detailed lolcat +- 🐱 Sitting cat +- 😸 Happy cat +- 😺 Stretching cat +- 😻 Playful cat +- 😴 Sleeping cat + +Each cat comes with its own personality and makes password generation more enjoyable! ## Command-Line Options -| Option | Description | Default | -|--------|-------------|---------| -| `--numbers N` | Number of random numbers to insert (1-10) | 3-5 | -| `--symbols N` | Number of symbols to insert (1-10) | 2 | -| `--max-length N` | Maximum password length (15-50) | 25 | -| `--test` | Run comprehensive tests | - | -| `--copy` | Copy password to clipboard (macOS only) | - | -| `--help` | Show help message | - | +MeowPassword supports both long and short option formats for convenience: + +| Long Option | Short | Description | Default | +|-------------|-------|-------------|---------| +| `--numbers N` | `-n N` | Number of random numbers to insert (1-10) | 1-4 (random) | +| `--symbols N` | `-s N` | Number of symbols to insert (1-10) | 2 | +| `--max-length N` | `-m N` | Maximum password length (15-50) | 25 | +| `--test` | `-t` | Run comprehensive tests | - | +| `--copy` | `-c` | Copy password to clipboard (macOS only) | - | +| `--help` | `-h` | Show detailed help message | - | + +### Option Details + +**Numbers (`-n`, `--numbers`)** +- Controls how many random digits (0-9) are inserted into the password +- Range: 1-10 +- Default: Randomly chosen between 1-4 for variety +- Example: `-n 4` inserts exactly 4 random digits + +**Symbols (`-s`, `--symbols`)** +- Controls how many special characters replace letters +- Range: 1-10 +- Default: 2 +- Available symbols: `!@#$%^&*()-_=+[]{;:.<>?` +- Example: `-s 3` replaces 3 letters with random symbols + +**Max Length (`-m`, `--max-length`)** +- Sets the maximum length of the generated password +- Range: 15-50 characters +- Default: 25 +- The password will not exceed this length +- Example: `-m 30` limits password to 30 characters + +### Usage Examples + +Generate a short, simple password: +```bash +meowpass -n 2 -s 1 -m 20 +``` + +Generate a long, complex password: +```bash +meowpass --numbers 8 --symbols 6 --max-length 45 +``` + +Generate and immediately copy to clipboard (macOS): +```bash +meowpass -n 5 -s 4 -c +``` + +View help for all options: +```bash +meowpass -h +``` ## Build System diff --git a/embedded_production.swift b/embedded_production.swift deleted file mode 100644 index ceaacc8..0000000 --- a/embedded_production.swift +++ /dev/null @@ -1,1003 +0,0 @@ -// MARK: - Embedded Cat Names Data (Production) -let embeddedCatNames: [String] = [ - "A Cappella", - "A Cat", - "A Net (aka Nettie)", - "A'ja (pronounced \"Asia\")", - "A.C. (Alternating Current)", - "A.C. (Another Cat)", - "A.C. (Attack Cat)", - "A.C. (Attitude Cat)", - "A.D.D. (Attention Deficit Disorder)", - "A.J. (Angelina Jolie)", - "A.J. (Angelo Jo)", - "A.L.F. (Alien Life Form)", - "A.V.P. (Alien vs Predator)", - "Aaargh", - "Aaliyah", - "Aaron", - "Ab", - "Ababa", - "Abba", - "Abba-daba", - "Abba-Goo", - "Abbey", - "Abbey Roads", - "Abbi-girl", - "Abbie", - "Abbot", - "Abbott", - "Abby", - "Abby-girl", - "Abby-normal", - "Abbykitty", - "Abcat", - "Abdul", - "Abe", - "Abednego", - "Abegale", - "Abel", - "Abelard", - "Abendigo", - "Abercrombie", - "Aberdeen", - "Abi", - "Abigail", - "Abigail Von Buttons", - "Abilene", - "Able", - "Abner", - "Abra", - "Abra (and Cadabra?)", - "Abracadabra", - "Abraham", - "Abraxas", - "Abrico", - "Abs", - "Absinthe", - "Absolon (from Chaucer's \"Cabterbury Tales\")", - "Absolut (named after the Swedish vodka)", - "Abstraction", - "Abu", - "Abubu", - "Aby", - "Abyss", - "Acat", - "Ace", - "Ace Baby Toadflakes", - "Ace Of Spades", - "Acey", - "Achille", - "Achilles (Greek mythology: Champion of the Greeks in the Trojan War)", - "Acis", - "Ackerly", - "Acorn", - "Acrolina", - "Acroy", - "Action", - "Ada", - "Ada Jane", - "Adacat", - "Adagio", - "Adakin Skywalker", - "Adam", - "Adam And Eve", - "Adams", - "Adcom", - "Addie", - "Addis", - "Addison", - "Addy", - "Addy-Tood", - "Adelaida", - "Adelaide", - "Ademma", - "Adidas", - "Adirondak", - "Adiza", - "Adlai", - "Adler", - "Admetus", - "Admiral", - "Adobe", - "Adolph", - "Adom", - "Adonis", - "Adrian", - "Adriatic", - "Adrock", - "Advance Cat", - "Aegyptos", - "Aelgifa (The Elven Gift - Old English)", - "Aelurus (Egyptian mythology, sacred cat)", - "Aenias", - "Aeolus (Greek God of the Wind)", - "Aerope", - "Aeros", - "Aesop", - "Aethelwyn", - "Aethra", - "Affinity", - "Afikoman", - "Afonia", - "Africa", - "African Queen", - "African-Americat", - "Afrikan", - "Afrikat", - "Agadore", - "Agamemnon", - "Agape (from the New Testament meaning unconditional love)", - "Agassi", - "Agatha", - "Agatha Christie", - "Agatha Christy", - "Agent Z", - "Aggedor", - "Aggie", - "Agili-tree", - "Agility", - "Agima", - "Agitador (Spanish for \"troublemaker\")", - "Agnes", - "Agrippina", - "Agustus", - "Ah Kinchil (Maya mythology: the sun god)", - "Ah Puch (Maya mythology: the god of death)", - "Ah-choo!", - "Ahab", - "Ahau Chamahez (Maya mythology: one of two gods of medicine)", - "Ahi", - "Ahlia", - "Ahmakiq (Maya mythology: god of agriculture)", - "Ahura Mazda", - "Aida", - "Aidan", - "Aiiy", - "Aikido", - "Aiko", - "Aimee", - "Air", - "Air Einstein", - "Air Raid", - "Airhead", - "AJ", - "Aja", - "Ajah (priesthood in fantasy games)", - "Ajax", - "Akaia", - "Akamai (Hawaiian for \"smart\")", - "Akasha", - "Akasha (character in Anne Rice's vampire chronicles)", - "Akasha (Queen Mother Vampire from Anne Rice's \"Queen of the Damned\")", - "Akbar", - "Akeel", - "Akeel The One Eyed", - "Akeela", - "Akeem", - "Akeisha", - "Aker (Egyptian mythology: the lion who guards the gates of dawn)", - "Akhen", - "Akhushtal (Maya mythology: goddess of childbirth)", - "Aki", - "Akim", - "Akira", - "Akita (Japanese breed of dog)", - "Aktil (after the mouse in \"Aktil's Big Swim\" children's book by Inga Moore)", - "Aku", - "Akula", - "Akuna", - "Al", - "Al Bundy", - "Al Capone", - "Al Pacino (after the actor)", - "Alabama", - "Alabaster", - "Aladara", - "Aladdin", - "Alakazam!", - "Alan", - "Alani", - "Alanna", - "Alaska", - "Alastair", - "Albatross", - "Albee (after the playwright Edward Albee)", - "Albert", - "Albert Einstein", - "Albert Oscelish Loudpurr", - "Alberta", - "Alberto", - "Albie-Capone", - "Albrecht", - "Alcatraz", - "Alchemy", - "Alcuin", - "Aldebaran", - "Aldo", - "Aldo Scalicki", - "Aldous (after the British author, Aldous Huxley)", - "Alecia", - "Alegra", - "Alegria Noah", - "Aleister", - "Aleksandra", - "Aleksei", - "Aleta", - "Alex", - "Alex P. Kitten", - "Alexa", - "Alexander", - "Alexander Blitzen Cody", - "Alexander Blue", - "Alexander-The-Great", - "Alexandra", - "Alexandra The Great", - "Alexandra The Grey", - "Alexandria", - "Alexandroupolis", - "Alexia", - "Alexis", - "Alf", - "Alfa Skywalker", - "Alfalfa", - "Alfanzo", - "Alfie", - "Alfie Moon (after the character in the \"Eastenders\" tv-series)", - "Alfiepet", - "Alfonzo", - "Alfred", - "Alfred \"Lord\" Tennyson", - "Alfreda", - "Algebra", - "Alger", - "Algernon", - "Algy", - "Ali", - "Ali Baba", - "Ali Kat", - "Ali Khat", - "Alia", - "Alibi", - "Alice", - "Alice B. Toe-Claws", - "Alice B. Toklas", - "Alien", - "Alika", - "Aliki", - "Alimony", - "Alina", - "Alise", - "Alistair", - "Alistair Jones", - "Alix", - "Aliza", - "Alize", - "All This and Heaven Too", - "Alla", - "Alladin", - "Allan", - "Allball", - "Allegra", - "Allegro", - "Allergen", - "Alley", - "Alley McClaw", - "Allie", - "Allie Cat", - "Allie Marie", - "Allison", - "Allison Jo", - "Allred", - "Allspice", - "Allura", - "Ally", - "Alma (Spanish for soul)", - "Almanzo", - "Almond Roca", - "Almost Paradise (song \"Almost Paradise\")", - "Aloha", - "Aloka", - "Alokee", - "Alomar", - "Alonzo", - "Alouiscious", - "Alowicious", - "Aloysius", - "Alpaca", - "Alpha", - "Alphie", - "Alpine", - "Alsatia", - "Althea", - "Alton", - "Aluminum", - "Alvin", - "Alwix", - "Alyssa", - "Alyx", - "Am-fats", - "Ama", - "Amable", - "Amadaeus", - "Amadala", - "Amadeus", - "Amadeus (after Mozart)", - "Amalthea", - "Amanda", - "Amandalina", - "Amanita", - "Amaretto", - "Amazing Grace", - "Amazon", - "Amba", - "Ambar", - "Ambassador", - "Amber", - "Amberwavesoffur", - "Ambidextrous", - "Ambiguity", - "Ambiguous Eunuch FarFromScrewin", - "Amble", - "Ambriel (Zodiac, guardian angel of Gemini)", - "Ambrose", - "Ambrose Ambrogo", - "Ambrose Bugger-Boo Pendragon", - "Ambrosia", - "Ambrosia Jean Marie", - "Ambrosious", - "Ambush", - "Amby", - "Amby (one of the feminine forms of Ambrose)", - "Amelia", - "Amelia Air-Cat", - "Amelia Earhart", - "Amelie (after the movie)", - "Amen-Ra", - "Amenhotep", - "America", - "American Pie", - "Americat", - "Amerito", - "Amethyst", - "Ami", - "Amida", - "Amidala", - "Amie", - "Amiga", - "Amigo", - "Amir", - "Amira (Female Arabian name, meaning \"princess\")", - "Ammie", - "Ammo", - "Amon", - "Amor (Spanish for \"love\")", - "Amore", - "Amos", - "Amour (French for \"love\")", - "Ampersand", - "Amphion", - "Amsterdam", - "Amtrak", - "Amulet", - "Amway", - "Amy", - "Amy Budd", - "Amydala", - "Ana", - "Ana-Hata", - "Anaakii (Japanese for \"anarchy\")", - "Anabel", - "Anabell", - "Anabelle", - "Anacharsis", - "Anaconda", - "Anais", - "Anakin", - "Anamokit (Indian for \"Little Thunder\")", - "Anastasia", - "Anastasia (after the Russian princess)", - "Anatevka", - "Anatole", - "Anatolius", - "Anatoly", - "Anchor", - "Anchors Away", - "Anchovey", - "Anchovy", - "Ancona", - "Andaconda", - "Andalusia", - "Anderson", - "Andi", - "Andie", - "Andilay, Andilay!", - "Andorra", - "Andouille (after the spicy Cajun sausage)", - "Andre", - "Andrea", - "Andrea Majorie", - "Andreas", - "Andrew", - "Andrew Elliott James David", - "Andrew Jackson", - "Android", - "Andromeda", - "Andy", - "Andy Rooney", - "Anfurnee", - "Angel", - "Angel Boy", - "Angel Cookie", - "Angel Eyes", - "Angel Marie", - "Angela", - "Angelee", - "Angelface", - "Angelica", - "Angelika", - "Angelika (after Angelika Foster-Gooding)", - "Angelina", - "Angeline", - "Angelo", - "Angelo Jo", - "Angie", - "Angstrom", - "Angus", - "Angus MacDoogal", - "Angus MacGuyver", - "Angus Pangus", - "Angus Suzy-Socks", - "Angy Poo", - "Ani", - "Ani Difranco", - "Anika", - "Anikki", - "Animal", - "Animophat", - "Anina", - "Anishka", - "Anita Blake (after the Laurel K. Hamilton novels)", - "Anitra", - "Ankelfraeseren", - "Ankle Biter", - "Ankle Dancer", - "Ann", - "Ann Jelly", - "Ann-Margaret", - "Anna", - "Anna-lynn", - "Annabel", - "Annabelle", - "Annakin (after Annakin Skywalker in the Star Wars movies)", - "Annapolis", - "Annapurna", - "Annelee", - "Annette", - "Annible", - "Annie", - "Annie Banannie", - "Annie Marie", - "Annie Pearl", - "Anniey", - "Anonka", - "Anonymous", - "Anouk (after Anouk Aimee)", - "Anouk Manouk", - "Anowa", - "Ansel", - "Ansel Adams", - "Ansel Catams", - "Antar (after a character in Arabic literature known for his bravery)", - "Antarctica", - "Antares", - "Antelope", - "Antha", - "Anthea", - "Anthem", - "Anthony", - "Anthrax P.H. (Poo Head) Zeppelin", - "Antic", - "Antigone", - "Anton", - "Anton B. Stanton", - "Antonia", - "Antonio", - "Antonio Banderas", - "Antony", - "Antony And Cleopatra", - "Antos", - "Antryg", - "Anubis", - "Anxiety", - "Anya", - "Apache", - "Aphrodisia", - "Aphrodite", - "Aphrodite, The Kitten Of Love", - "Apie", - "Apocalypse", - "Apocalypse Now", - "Apogee", - "Apollo", - "Apollo (the mythological god of light and truth)", - "Apollonia", - "Apothecary", - "Applaton", - "Apple", - "Apple Dog", - "Apple Pie", - "Applejack", - "Applesauce", - "Appleton", - "Appollinia", - "Apprentice", - "Appy", - "Apri", - "Apricot", - "April", - "Aptos", - "Apu", - "Aput", - "Apuu", - "Aqua", - "Aqua Girl", - "Aquarius", - "Ar-too", - "Arachne", - "Aragorn", - "Araine", - "Aramer", - "Aramis (one of the three muskateers)", - "Arapaho", - "Arbitration", - "Arbuckle (after the silent film comedian)", - "Arbutis", - "Arby", - "Archibald", - "Archie", - "Archie Bunker", - "Archima", - "Archimedes", - "Ardal", - "Area 51", - "Arejay Joseph (Arejay from the band Halestorm)", - "Arendal", - "Ares", - "Arf", - "Arfie", - "Arfur", - "Argent", - "Argo", - "Argon", - "Argos", - "Argus", - "Argyle", - "Ari", - "Aria", - "Ariadne (Greek mythology, daughter of King Minos of Crete)", - "Ariel", - "Ariel (from the movie \"The Little Mermaid\")", - "Ariela (Hebrew for \"female derivative of lioness\")", - "Arielle", - "Aries", - "Arietty", - "Arioch", - "Arista Kat", - "AristoCat", - "Aristophanes", - "Aristotle", - "Arizona", - "Arlene", - "Arlington", - "Arlo", - "Arly", - "Armageddon", - "Armani", - "Armie", - "Arms", - "Arms Von Hirshstein", - "Armstrong", - "Arnie", - "Arnold", - "Arnold Schwarzenegger", - "Arnold Shortzenlegger", - "Arpeggio", - "Arquette", - "Arriana", - "Arrow", - "Arsenic", - "Artemis", - "Artemis (Greek goddess of hunting and moon)", - "Artera", - "Artesian", - "Artful Dodger", - "Arthur", - "Arthur Ambrosius", - "Arti", - "Artie", - "Arty", - "Arvo", - "Arwen", - "Arwen Renaissance", - "Arzu (Turkish for \"desire\")", - "Asbury (after Asbury Park, NJ)", - "ASCII (computer term)", - "Ash", - "Ash-butt", - "Asha", - "Ashanti", - "Ashben", - "Asheema", - "Asher", - "Ashes", - "Ashes Too Ashes", - "Ashford", - "Ashika", - "Ashke", - "Ashleigh", - "Ashley", - "Ashley Cat", - "Ashley Olsen", - "Ashley Wilkes", - "Ashli", - "Ashlyn", - "Ashrei (Hebrew for \"happy\")", - "Ashton", - "Ashur", - "Asia", - "Asia Major", - "Asia Minor", - "Asimov", - "Asja", - "Aska", - "Asker", - "Askhim", - "Aslan", - "Asparagus", - "Aspen", - "Asphalt", - "Aspirin", - "Asscaught", - "Asset", - "Asta", - "Astarael", - "Astarte", - "Aster", - "Asterix", - "Asteroid", - "Asti", - "Asti Spumonte", - "Astor", - "Astra", - "Astro", - "Astroid", - "Astrology", - "Astroman", - "Astrophe", - "Asylum", - "Asymptote", - "Atair", - "Atari", - "Ateesha", - "Athalia", - "Athena (Goddess of War)", - "Athene", - "Athens", - "Athinai", - "Atilla", - "Atinna", - "Atlantic", - "Atlantis", - "Atlas", - "Atom", - "Atossa", - "Attacker", - "Atte", - "Atti (short for attitude)", - "Atticus", - "Attila", - "Attitude", - "Atude", - "Aubergine", - "Aubrey", - "Audacity", - "Audball", - "Auden (named after the poet W.H. Auden)", - "Audie", - "Audio", - "Auditor", - "Audrey", - "Audrey Hepburn", - "Audrey III", - "Audubon (after John James Audubon)", - "Augger-Dogger", - "Auggie", - "Auggie Doggie", - "Auggie or Augie", - "Augie", - "August", - "August Nights", - "Augusta", - "Auguste Eighth Month.", - "Augustiko", - "Augustin", - "Augustina", - "Augustine \"Gus\" Hoover", - "Augustus", - "Aunt Esther", - "Aunt Jemima", - "Aunt Kat", - "Aunt Margaret", - "Auntie Stella", - "Aura", - "Aureim", - "Aureole", - "Aurey", - "Aurora", - "Aurora Borealis", - "Aussie", - "Austin", - "Austin Meowers", - "Austin Powers", - "Autobahn", - "Autumn", - "Ava", - "Avagadros (after the mathmetician)", - "Avail", - "Avalanche", - "Avalon", - "Avanti", - "Avatar", - "Avery", - "Avis", - "Avocado", - "Avril", - "Awesie", - "Awesome Kitty", - "Awestruck", - "Awk", - "Axel", - "Axl", - "Axl Rose", - "Axle", - "Axon", - "Ayame (Japanese for \"iris\")", - "Ayesha (3rd wife of Mohammed)", - "Ayisha", - "Ayla", - "Aylin", - "Aymaya (Japanese for \"night rain\")", - "Ayra", - "Ayreh", - "Ayun (As Yet Un-named)", - "Azar", - "Azark", - "Azazel (means \"desert demon\", Bible: Leviticus)", - "Azil", - "Aziza (\"precious one\" in a few different languages)", - "Azmodius", - "Azour Mavreen", - "Azrael", - "Azreal", - "Aztec", - "Azure", - "Azzuki", - "Azzul", - "B-52", - "B-dee", - "B-Girl", - "B-Pal", - "B.A.", - "B.A. (Bad Attitude!)", - "B.A. Barrakus", - "B.B.", - "B.B. Kat", - "B.B. King", - "B.B. Kingcat", - "B.C.", - "B.C. (\"Buttercup\")", - "B.C. (Big Cat)", - "B.D. (\"Black Douglas\", after the feisty Scottish warrior)", - "B.D. (Bad Boy)", - "B.D. (Brain-Dead)", - "B.D.K. (\"Buddy D. Katt\")", - "B.e.r.u. (Banana Emergency Recovery Unit, also Luke Skywalkers aunt and an island in the Pacific Ocean)", - "B.G.", - "B.I.F. (Butt In Face)", - "B.J.", - "B.J. (Tom Robbin's character Bonanza Jellybean)", - "B.K.", - "B.M.W. (Black, Mahogany & White)", - "B.O.T. (Big Old Tom)", - "B.u.d. (\"Big Ugly and Dumb\")", - "B.W.", - "B.W. (Black White)", - "BA", - "Ba Shaleek Alshain", - "Ba' Boy", - "Baba", - "Babaganoush", - "Babalou (after the tv show)", - "Babar", - "Babbaboombanorsh", - "Babbit", - "Babbitt", - "Babe", - "Babee", - "Babers", - "Babester", - "Babette", - "Babirusa", - "Baboo", - "Baboon Butt", - "Babricus", - "Babs (after Barbra Streisand)", - "Babsy", - "Babuji Braveheart", - "Babur", - "Babushka", - "Baby", - "Baby Bear", - "Baby Beauty", - "Baby Boogens", - "Baby Boy", - "Baby Bug", - "Baby Butterscotch", - "Baby Cakes", - "Baby Cat", - "Baby Doe (sort of a Jane Doe thang)", - "Baby Dog", - "Baby Doll", - "Baby Doo II", - "Baby Dumpling", - "Baby Girl", - "Baby Grey.", - "Baby Guiness", - "Baby Head", - "Baby Jane", - "Baby Jesus", - "Baby Ki'n", - "Baby Kitten", - "Baby Kitty", - "Baby Kitty And Trouble", - "Baby Mimi", - "Baby Nesbit", - "Baby Ruth", - "Baby Seebs", - "Baby Spice", - "Baby Weeeeeeezel the little Frrrrrench Chat", - "Baby-Boogs", - "Baby-Doll", - "Baby-Doo", - "Baby-Face", - "Baby-Kitty", - "Baby-Roca (named after two favorite candies, Baby Ruth and Almond Roca)", - "Babycakes", - "Babycat", - "Babydoll", - "Babyface", - "Babygray", - "Babykins", - "Babyman", - "Babyshoes", - "Babytat", - "Bacabs (Maya mythology: the canopic gods)", - "Bacall", - "Bacardi", - "Baccarat", - "Bacchos", - "Bacchus", - "Bacci (pronounced: Baa-chie; Italian for \"kisses\")", - "Bach", - "Baci", - "Back", - "Backstreet Blues", - "Backstreet Kitty", - "Bacon", - "Bad Bad Boy", - "Bad Bad Leroy Brown", - "Bad Bess", - "Bad Cat", - "Bad Kitty", - "Bad Luck", - "Bada", - "Badger", - "Badjun", - "Badlands", - "Badness", - "BadShad", - "Baeki", - "Bafftub", - "Bag", - "Bag Lady", - "Bag O'Cat", - "Bagel", - "Baggage", - "Baggi pants", - "Baggins", - "Baggy", - "Bagheera", - "Baghera (black panther in \"The Jungle Book\")", - "Baghreeah", - "Bagira", - "Bagoas", - "Bagpuss", - "Baguette", - "Bahama Mama", - "Bailey", - "Bailey Emerald Isle", - "Bailey's Irish Cream (50% sweetness and 50% nuts)", - "Bain", - "Bainbridge", - "Baja", - "Bajan", - "Baka (Japanese insult, \"idiot\", \"moron\", \"fool\", \"dimwit\")", - "Baka-Neko", - "Baker", - "Baker (after the mountain in North Carolina, USA)", - "Baksheesh (means \"bribe\" in Arabic)", - "Balaena", - "Balbina", - "Balboa", - "Balder (Viking mythology: The God of light)", - "Balderdash", - "Baldric", - "Baldrick", - "Baldur", - "Baldur The Fairly Slow", - "Baldwin", - "Baldy", - "Bali", - "Balik", - "Balin", - "Balki", - "Ballbearing Mouse Trap", - "Ballerina", - "Ballou", - "Ballsy", - "Baloo", - "Balraj", - "Balthazar", - "Balzac", - "Bam", - "Bam-Bam", - "Bama", - "Bambalona", - "Bambam", - "Bambi", - "Bambina", - "Bambino", - "Bamboo", - "Bamboozler", - "Bams", - "Bamse", - "Banana Cabana", - "Banana Peel", - "Band-Aid", - "Bandanna", - "Bandit", - "Bandito", - "Bang (reference to the Unix ! symbol)", - "Bangladesh", - "Bangle", - "Bangui (capital of Central African Republic)", - "Banjer", - "Banjo", - "Banjo Blue", - "Bannana Fanna", - "Bannenay", - "Banner", - "Banquet", - "Banquo", - "Banshee", - "Banzai", - "Bar Room", - "Baracca", - "Barbara", - "Barbara Bush", - "Barbarella (after the Jane Fonda movie)", - "Barbarian", - "Barbarino", - "Barbeque", -] diff --git a/main.swift b/main.swift index 5b96614..136ca8d 100644 --- a/main.swift +++ b/main.swift @@ -8,7 +8,14 @@ import Foundation // MARK: - ASCII Art and Lolcat Theme -let lolcatArt = """ + +/** + * Collection of ASCII art cats for randomized display + * Each run selects a random cat to display, adding variety to the user experience + */ +let asciiCats = [ + // Original lolcat + """ _,-;'''`' - . _/', `; `; \\ , _..,-'' ' ` ` `\\ @@ -18,13 +25,74 @@ let lolcatArt = """ ; (6_); (6_) ; | , \\ ' | ;; _,6 ,. ` `, ' `-._ // ,;.=..`_..=.,' -' ,'' _,// -_00_____`"=,,,=="',___,,,-----'''----'_'_'_''______00_ - Meow Password Generators of Secure Relavant + _00_____`"=,,,=="',___,,,-----'''----'_'_'_''______00_ + Meow Password Generators of Secure Relevant __,,-' /' /'_,,--'' | ( `' -""" + """, + + // Sitting cat + """ + /\\_/\\ + ( o.o ) + > ^ < + /| |\\ + (_| |_) + + 🐱 MeowPassword - Purrfectly Secure! 🐱 + """, + + // Happy cat + """ + |\\__/,| (`\\ + |_ _ |.--.) ) + ( T ) / + (((^_(((/(((_/ + + 😸 MeowPassword - Happy to Help! 😸 + """, + + // Stretching cat + """ + /\\_/\\ + ( ^.^ ) _ + \\ " / ( ) + ( | | ) + (__d b__) + + 😺 MeowPassword - Stretching Your Security! 😺 + """, + + // Playful cat + """ + /\\_/\\ ___ + = o_o =_______ \\ \\ + __^ __( \\.__) ) + (@)<_____>__(_____)____/ + + 😻 MeowPassword - Playfully Secure! 😻 + """, + + // Sleeping cat + """ + |\\ _,,,---,,_ + ZZZzz /,`.-'`' -. ;-;;,_ + |,4- ) )-,_. ,\\ ( `'-' + '---''(_/--' `-'\\_) + + 😴 MeowPassword - Quietly Securing... 😴 + """ +] + +/** + * Get a random ASCII art cat from the collection + * @return A randomly selected ASCII art string + */ +func getRandomCatArt() -> String { + return asciiCats.randomElement() ?? asciiCats[0] +} // MARK: - Configuration Structure /** @@ -37,40 +105,78 @@ struct PasswordConfig { let maxLength: Int // Maximum password length (15-50) let showTests: Bool // Whether to run test mode let copyToClipboard: Bool // Whether to copy result to clipboard + let showHelp: Bool // Whether to show help /** * Initialize configuration from command line arguments * @param arguments: Array of command line arguments */ init(arguments: [String]) { - var numNumbers = Int.random(in: 1...4) // Default range as specified in requirements - var numSymbols = 2 // Default value as specified in requirements - var maxLength = 25 // Default max length as specified in requirements + var numNumbers = Int.random(in: 1...4) // Default range: 1-4 numbers (randomly chosen) + var numSymbols = 2 // Default value: 2 symbols + var maxLength = 25 // Default max length: 25 characters var showTests = false var copyToClipboard = false + var showHelp = false // Parse command line arguments with validation - for i in 0..= 1 && value <= 10 { + numNumbers = value + i += 1 // Skip next argument (the value) + } else { + print("Warning: --numbers/-n must be between 1-10. Using default: random 1-4") + } + } else { + print("Warning: --numbers/-n requires a numeric value. Using default: random 1-4") } - case "--symbols": + + case "--symbols", "-s": if i + 1 < arguments.count, let value = Int(arguments[i + 1]) { - numSymbols = max(1, min(10, value)) // Clamp between 1-10 + if value >= 1 && value <= 10 { + numSymbols = value + i += 1 // Skip next argument (the value) + } else { + print("Warning: --symbols/-s must be between 1-10. Using default: 2") + } + } else { + print("Warning: --symbols/-s requires a numeric value. Using default: 2") } - case "--max-length": + + case "--max-length", "-m": if i + 1 < arguments.count, let value = Int(arguments[i + 1]) { - maxLength = max(15, min(50, value)) // Clamp between 15-50 + if value >= 15 && value <= 50 { + maxLength = value + i += 1 // Skip next argument (the value) + } else { + print("Warning: --max-length/-m must be between 15-50. Using default: 25") + } + } else { + print("Warning: --max-length/-m requires a numeric value. Using default: 25") } - case "--test": + + case "--test", "-t": showTests = true - case "--copy": + + case "--copy", "-c": copyToClipboard = true + + case "--help", "-h": + showHelp = true + default: - break + if arg.hasPrefix("-") { + print("Warning: Unknown option '\(arg)'. Use --help for usage information.") + } } + + i += 1 } self.numNumbers = numNumbers @@ -78,6 +184,7 @@ struct PasswordConfig { self.maxLength = maxLength self.showTests = showTests self.copyToClipboard = copyToClipboard + self.showHelp = showHelp } } @@ -443,22 +550,58 @@ func runBasicTests() { * Shows all available options and example usage */ func showHelp() { - print("MeowPassword - Cat Dyanmic Secure Password Generator") - print("") - print("Usage: meowpass [options]") - print("") - print("Options:") - print(" --numbers N Number of random numbers to insert (1-10, default: 3-5)") - print(" --symbols N Number of symbols to insert (1-10, default: 2)") - print(" --max-length N Maximum password length (15-50, default: 25)") - print(" --test Run tests") - print(" --copy Copy password to clipboard (macOS only)") - print(" --help Show this help message") - print("") - print("Examples:") - print(" meowpass") - print(" meowpass --numbers 4 --symbols 3 --max-length 30") - print(" meowpass --test") + print(""" + MeowPassword - Cat-Based Secure Password Generator + + USAGE: + meowpass [OPTIONS] + + OPTIONS: + -n, --numbers N Number of random numbers to insert (1-10) + Default: 1-4 (randomly chosen) + + -s, --symbols N Number of symbols to insert (1-10) + Default: 2 + + -m, --max-length N Maximum password length (15-50) + Default: 25 + + -t, --test Run comprehensive tests + + -c, --copy Copy generated password to clipboard + (macOS only) + + -h, --help Show this help message + + DESCRIPTION: + MeowPassword generates secure, memorable passwords using cat names + combined with Kolmogorov complexity analysis. Each run displays a + random ASCII art cat for a delightful experience! + + Features: + • 1000+ embedded cat names (no external files needed) + • Random ASCII art cat on each run + • Configurable security parameters + • Kolmogorov complexity scoring + • Generates 5 candidates and selects the most secure + + EXAMPLES: + Generate a password with default settings: + meowpass + + Generate with custom parameters: + meowpass --numbers 4 --symbols 3 --max-length 30 + meowpass -n 5 -s 4 -m 35 + + Generate and copy to clipboard: + meowpass --copy + meowpass -c + + Run tests: + meowpass --test + meowpass -t + + """) } // MARK: - Main Program @@ -466,7 +609,7 @@ func main() { let config = PasswordConfig(arguments: CommandLine.arguments) // Check for help - if CommandLine.arguments.contains("--help") { + if config.showHelp { showHelp() return } @@ -477,10 +620,10 @@ func main() { return } - // Show ASCII art and title - print(lolcatArt) - print("Meow Password - Cat Name Based Secure Password Generator") - print("========================================================") + // Show random ASCII art and title + print(getRandomCatArt()) + print("\nMeow Password - Cat Name Based Secure Password Generator") + print("==========================================================") // Load cat names (now from embedded data) let catNames = loadCatNames() diff --git a/meowpass_production.swift b/meowpass_production.swift deleted file mode 100644 index 473ab48..0000000 --- a/meowpass_production.swift +++ /dev/null @@ -1,1556 +0,0 @@ -// MARK: - Embedded Cat Names Data (Production) -let embeddedCatNames: [String] = [ - "A Cappella", - "A Cat", - "A Net (aka Nettie)", - "A'ja (pronounced \"Asia\")", - "A.C. (Alternating Current)", - "A.C. (Another Cat)", - "A.C. (Attack Cat)", - "A.C. (Attitude Cat)", - "A.D.D. (Attention Deficit Disorder)", - "A.J. (Angelina Jolie)", - "A.J. (Angelo Jo)", - "A.L.F. (Alien Life Form)", - "A.V.P. (Alien vs Predator)", - "Aaargh", - "Aaliyah", - "Aaron", - "Ab", - "Ababa", - "Abba", - "Abba-daba", - "Abba-Goo", - "Abbey", - "Abbey Roads", - "Abbi-girl", - "Abbie", - "Abbot", - "Abbott", - "Abby", - "Abby-girl", - "Abby-normal", - "Abbykitty", - "Abcat", - "Abdul", - "Abe", - "Abednego", - "Abegale", - "Abel", - "Abelard", - "Abendigo", - "Abercrombie", - "Aberdeen", - "Abi", - "Abigail", - "Abigail Von Buttons", - "Abilene", - "Able", - "Abner", - "Abra", - "Abra (and Cadabra?)", - "Abracadabra", - "Abraham", - "Abraxas", - "Abrico", - "Abs", - "Absinthe", - "Absolon (from Chaucer's \"Cabterbury Tales\")", - "Absolut (named after the Swedish vodka)", - "Abstraction", - "Abu", - "Abubu", - "Aby", - "Abyss", - "Acat", - "Ace", - "Ace Baby Toadflakes", - "Ace Of Spades", - "Acey", - "Achille", - "Achilles (Greek mythology: Champion of the Greeks in the Trojan War)", - "Acis", - "Ackerly", - "Acorn", - "Acrolina", - "Acroy", - "Action", - "Ada", - "Ada Jane", - "Adacat", - "Adagio", - "Adakin Skywalker", - "Adam", - "Adam And Eve", - "Adams", - "Adcom", - "Addie", - "Addis", - "Addison", - "Addy", - "Addy-Tood", - "Adelaida", - "Adelaide", - "Ademma", - "Adidas", - "Adirondak", - "Adiza", - "Adlai", - "Adler", - "Admetus", - "Admiral", - "Adobe", - "Adolph", - "Adom", - "Adonis", - "Adrian", - "Adriatic", - "Adrock", - "Advance Cat", - "Aegyptos", - "Aelgifa (The Elven Gift - Old English)", - "Aelurus (Egyptian mythology, sacred cat)", - "Aenias", - "Aeolus (Greek God of the Wind)", - "Aerope", - "Aeros", - "Aesop", - "Aethelwyn", - "Aethra", - "Affinity", - "Afikoman", - "Afonia", - "Africa", - "African Queen", - "African-Americat", - "Afrikan", - "Afrikat", - "Agadore", - "Agamemnon", - "Agape (from the New Testament meaning unconditional love)", - "Agassi", - "Agatha", - "Agatha Christie", - "Agatha Christy", - "Agent Z", - "Aggedor", - "Aggie", - "Agili-tree", - "Agility", - "Agima", - "Agitador (Spanish for \"troublemaker\")", - "Agnes", - "Agrippina", - "Agustus", - "Ah Kinchil (Maya mythology: the sun god)", - "Ah Puch (Maya mythology: the god of death)", - "Ah-choo!", - "Ahab", - "Ahau Chamahez (Maya mythology: one of two gods of medicine)", - "Ahi", - "Ahlia", - "Ahmakiq (Maya mythology: god of agriculture)", - "Ahura Mazda", - "Aida", - "Aidan", - "Aiiy", - "Aikido", - "Aiko", - "Aimee", - "Air", - "Air Einstein", - "Air Raid", - "Airhead", - "AJ", - "Aja", - "Ajah (priesthood in fantasy games)", - "Ajax", - "Akaia", - "Akamai (Hawaiian for \"smart\")", - "Akasha", - "Akasha (character in Anne Rice's vampire chronicles)", - "Akasha (Queen Mother Vampire from Anne Rice's \"Queen of the Damned\")", - "Akbar", - "Akeel", - "Akeel The One Eyed", - "Akeela", - "Akeem", - "Akeisha", - "Aker (Egyptian mythology: the lion who guards the gates of dawn)", - "Akhen", - "Akhushtal (Maya mythology: goddess of childbirth)", - "Aki", - "Akim", - "Akira", - "Akita (Japanese breed of dog)", - "Aktil (after the mouse in \"Aktil's Big Swim\" children's book by Inga Moore)", - "Aku", - "Akula", - "Akuna", - "Al", - "Al Bundy", - "Al Capone", - "Al Pacino (after the actor)", - "Alabama", - "Alabaster", - "Aladara", - "Aladdin", - "Alakazam!", - "Alan", - "Alani", - "Alanna", - "Alaska", - "Alastair", - "Albatross", - "Albee (after the playwright Edward Albee)", - "Albert", - "Albert Einstein", - "Albert Oscelish Loudpurr", - "Alberta", - "Alberto", - "Albie-Capone", - "Albrecht", - "Alcatraz", - "Alchemy", - "Alcuin", - "Aldebaran", - "Aldo", - "Aldo Scalicki", - "Aldous (after the British author, Aldous Huxley)", - "Alecia", - "Alegra", - "Alegria Noah", - "Aleister", - "Aleksandra", - "Aleksei", - "Aleta", - "Alex", - "Alex P. Kitten", - "Alexa", - "Alexander", - "Alexander Blitzen Cody", - "Alexander Blue", - "Alexander-The-Great", - "Alexandra", - "Alexandra The Great", - "Alexandra The Grey", - "Alexandria", - "Alexandroupolis", - "Alexia", - "Alexis", - "Alf", - "Alfa Skywalker", - "Alfalfa", - "Alfanzo", - "Alfie", - "Alfie Moon (after the character in the \"Eastenders\" tv-series)", - "Alfiepet", - "Alfonzo", - "Alfred", - "Alfred \"Lord\" Tennyson", - "Alfreda", - "Algebra", - "Alger", - "Algernon", - "Algy", - "Ali", - "Ali Baba", - "Ali Kat", - "Ali Khat", - "Alia", - "Alibi", - "Alice", - "Alice B. Toe-Claws", - "Alice B. Toklas", - "Alien", - "Alika", - "Aliki", - "Alimony", - "Alina", - "Alise", - "Alistair", - "Alistair Jones", - "Alix", - "Aliza", - "Alize", - "All This and Heaven Too", - "Alla", - "Alladin", - "Allan", - "Allball", - "Allegra", - "Allegro", - "Allergen", - "Alley", - "Alley McClaw", - "Allie", - "Allie Cat", - "Allie Marie", - "Allison", - "Allison Jo", - "Allred", - "Allspice", - "Allura", - "Ally", - "Alma (Spanish for soul)", - "Almanzo", - "Almond Roca", - "Almost Paradise (song \"Almost Paradise\")", - "Aloha", - "Aloka", - "Alokee", - "Alomar", - "Alonzo", - "Alouiscious", - "Alowicious", - "Aloysius", - "Alpaca", - "Alpha", - "Alphie", - "Alpine", - "Alsatia", - "Althea", - "Alton", - "Aluminum", - "Alvin", - "Alwix", - "Alyssa", - "Alyx", - "Am-fats", - "Ama", - "Amable", - "Amadaeus", - "Amadala", - "Amadeus", - "Amadeus (after Mozart)", - "Amalthea", - "Amanda", - "Amandalina", - "Amanita", - "Amaretto", - "Amazing Grace", - "Amazon", - "Amba", - "Ambar", - "Ambassador", - "Amber", - "Amberwavesoffur", - "Ambidextrous", - "Ambiguity", - "Ambiguous Eunuch FarFromScrewin", - "Amble", - "Ambriel (Zodiac, guardian angel of Gemini)", - "Ambrose", - "Ambrose Ambrogo", - "Ambrose Bugger-Boo Pendragon", - "Ambrosia", - "Ambrosia Jean Marie", - "Ambrosious", - "Ambush", - "Amby", - "Amby (one of the feminine forms of Ambrose)", - "Amelia", - "Amelia Air-Cat", - "Amelia Earhart", - "Amelie (after the movie)", - "Amen-Ra", - "Amenhotep", - "America", - "American Pie", - "Americat", - "Amerito", - "Amethyst", - "Ami", - "Amida", - "Amidala", - "Amie", - "Amiga", - "Amigo", - "Amir", - "Amira (Female Arabian name, meaning \"princess\")", - "Ammie", - "Ammo", - "Amon", - "Amor (Spanish for \"love\")", - "Amore", - "Amos", - "Amour (French for \"love\")", - "Ampersand", - "Amphion", - "Amsterdam", - "Amtrak", - "Amulet", - "Amway", - "Amy", - "Amy Budd", - "Amydala", - "Ana", - "Ana-Hata", - "Anaakii (Japanese for \"anarchy\")", - "Anabel", - "Anabell", - "Anabelle", - "Anacharsis", - "Anaconda", - "Anais", - "Anakin", - "Anamokit (Indian for \"Little Thunder\")", - "Anastasia", - "Anastasia (after the Russian princess)", - "Anatevka", - "Anatole", - "Anatolius", - "Anatoly", - "Anchor", - "Anchors Away", - "Anchovey", - "Anchovy", - "Ancona", - "Andaconda", - "Andalusia", - "Anderson", - "Andi", - "Andie", - "Andilay, Andilay!", - "Andorra", - "Andouille (after the spicy Cajun sausage)", - "Andre", - "Andrea", - "Andrea Majorie", - "Andreas", - "Andrew", - "Andrew Elliott James David", - "Andrew Jackson", - "Android", - "Andromeda", - "Andy", - "Andy Rooney", - "Anfurnee", - "Angel", - "Angel Boy", - "Angel Cookie", - "Angel Eyes", - "Angel Marie", - "Angela", - "Angelee", - "Angelface", - "Angelica", - "Angelika", - "Angelika (after Angelika Foster-Gooding)", - "Angelina", - "Angeline", - "Angelo", - "Angelo Jo", - "Angie", - "Angstrom", - "Angus", - "Angus MacDoogal", - "Angus MacGuyver", - "Angus Pangus", - "Angus Suzy-Socks", - "Angy Poo", - "Ani", - "Ani Difranco", - "Anika", - "Anikki", - "Animal", - "Animophat", - "Anina", - "Anishka", - "Anita Blake (after the Laurel K. Hamilton novels)", - "Anitra", - "Ankelfraeseren", - "Ankle Biter", - "Ankle Dancer", - "Ann", - "Ann Jelly", - "Ann-Margaret", - "Anna", - "Anna-lynn", - "Annabel", - "Annabelle", - "Annakin (after Annakin Skywalker in the Star Wars movies)", - "Annapolis", - "Annapurna", - "Annelee", - "Annette", - "Annible", - "Annie", - "Annie Banannie", - "Annie Marie", - "Annie Pearl", - "Anniey", - "Anonka", - "Anonymous", - "Anouk (after Anouk Aimee)", - "Anouk Manouk", - "Anowa", - "Ansel", - "Ansel Adams", - "Ansel Catams", - "Antar (after a character in Arabic literature known for his bravery)", - "Antarctica", - "Antares", - "Antelope", - "Antha", - "Anthea", - "Anthem", - "Anthony", - "Anthrax P.H. (Poo Head) Zeppelin", - "Antic", - "Antigone", - "Anton", - "Anton B. Stanton", - "Antonia", - "Antonio", - "Antonio Banderas", - "Antony", - "Antony And Cleopatra", - "Antos", - "Antryg", - "Anubis", - "Anxiety", - "Anya", - "Apache", - "Aphrodisia", - "Aphrodite", - "Aphrodite, The Kitten Of Love", - "Apie", - "Apocalypse", - "Apocalypse Now", - "Apogee", - "Apollo", - "Apollo (the mythological god of light and truth)", - "Apollonia", - "Apothecary", - "Applaton", - "Apple", - "Apple Dog", - "Apple Pie", - "Applejack", - "Applesauce", - "Appleton", - "Appollinia", - "Apprentice", - "Appy", - "Apri", - "Apricot", - "April", - "Aptos", - "Apu", - "Aput", - "Apuu", - "Aqua", - "Aqua Girl", - "Aquarius", - "Ar-too", - "Arachne", - "Aragorn", - "Araine", - "Aramer", - "Aramis (one of the three muskateers)", - "Arapaho", - "Arbitration", - "Arbuckle (after the silent film comedian)", - "Arbutis", - "Arby", - "Archibald", - "Archie", - "Archie Bunker", - "Archima", - "Archimedes", - "Ardal", - "Area 51", - "Arejay Joseph (Arejay from the band Halestorm)", - "Arendal", - "Ares", - "Arf", - "Arfie", - "Arfur", - "Argent", - "Argo", - "Argon", - "Argos", - "Argus", - "Argyle", - "Ari", - "Aria", - "Ariadne (Greek mythology, daughter of King Minos of Crete)", - "Ariel", - "Ariel (from the movie \"The Little Mermaid\")", - "Ariela (Hebrew for \"female derivative of lioness\")", - "Arielle", - "Aries", - "Arietty", - "Arioch", - "Arista Kat", - "AristoCat", - "Aristophanes", - "Aristotle", - "Arizona", - "Arlene", - "Arlington", - "Arlo", - "Arly", - "Armageddon", - "Armani", - "Armie", - "Arms", - "Arms Von Hirshstein", - "Armstrong", - "Arnie", - "Arnold", - "Arnold Schwarzenegger", - "Arnold Shortzenlegger", - "Arpeggio", - "Arquette", - "Arriana", - "Arrow", - "Arsenic", - "Artemis", - "Artemis (Greek goddess of hunting and moon)", - "Artera", - "Artesian", - "Artful Dodger", - "Arthur", - "Arthur Ambrosius", - "Arti", - "Artie", - "Arty", - "Arvo", - "Arwen", - "Arwen Renaissance", - "Arzu (Turkish for \"desire\")", - "Asbury (after Asbury Park, NJ)", - "ASCII (computer term)", - "Ash", - "Ash-butt", - "Asha", - "Ashanti", - "Ashben", - "Asheema", - "Asher", - "Ashes", - "Ashes Too Ashes", - "Ashford", - "Ashika", - "Ashke", - "Ashleigh", - "Ashley", - "Ashley Cat", - "Ashley Olsen", - "Ashley Wilkes", - "Ashli", - "Ashlyn", - "Ashrei (Hebrew for \"happy\")", - "Ashton", - "Ashur", - "Asia", - "Asia Major", - "Asia Minor", - "Asimov", - "Asja", - "Aska", - "Asker", - "Askhim", - "Aslan", - "Asparagus", - "Aspen", - "Asphalt", - "Aspirin", - "Asscaught", - "Asset", - "Asta", - "Astarael", - "Astarte", - "Aster", - "Asterix", - "Asteroid", - "Asti", - "Asti Spumonte", - "Astor", - "Astra", - "Astro", - "Astroid", - "Astrology", - "Astroman", - "Astrophe", - "Asylum", - "Asymptote", - "Atair", - "Atari", - "Ateesha", - "Athalia", - "Athena (Goddess of War)", - "Athene", - "Athens", - "Athinai", - "Atilla", - "Atinna", - "Atlantic", - "Atlantis", - "Atlas", - "Atom", - "Atossa", - "Attacker", - "Atte", - "Atti (short for attitude)", - "Atticus", - "Attila", - "Attitude", - "Atude", - "Aubergine", - "Aubrey", - "Audacity", - "Audball", - "Auden (named after the poet W.H. Auden)", - "Audie", - "Audio", - "Auditor", - "Audrey", - "Audrey Hepburn", - "Audrey III", - "Audubon (after John James Audubon)", - "Augger-Dogger", - "Auggie", - "Auggie Doggie", - "Auggie or Augie", - "Augie", - "August", - "August Nights", - "Augusta", - "Auguste Eighth Month.", - "Augustiko", - "Augustin", - "Augustina", - "Augustine \"Gus\" Hoover", - "Augustus", - "Aunt Esther", - "Aunt Jemima", - "Aunt Kat", - "Aunt Margaret", - "Auntie Stella", - "Aura", - "Aureim", - "Aureole", - "Aurey", - "Aurora", - "Aurora Borealis", - "Aussie", - "Austin", - "Austin Meowers", - "Austin Powers", - "Autobahn", - "Autumn", - "Ava", - "Avagadros (after the mathmetician)", - "Avail", - "Avalanche", - "Avalon", - "Avanti", - "Avatar", - "Avery", - "Avis", - "Avocado", - "Avril", - "Awesie", - "Awesome Kitty", - "Awestruck", - "Awk", - "Axel", - "Axl", - "Axl Rose", - "Axle", - "Axon", - "Ayame (Japanese for \"iris\")", - "Ayesha (3rd wife of Mohammed)", - "Ayisha", - "Ayla", - "Aylin", - "Aymaya (Japanese for \"night rain\")", - "Ayra", - "Ayreh", - "Ayun (As Yet Un-named)", - "Azar", - "Azark", - "Azazel (means \"desert demon\", Bible: Leviticus)", - "Azil", - "Aziza (\"precious one\" in a few different languages)", - "Azmodius", - "Azour Mavreen", - "Azrael", - "Azreal", - "Aztec", - "Azure", - "Azzuki", - "Azzul", - "B-52", - "B-dee", - "B-Girl", - "B-Pal", - "B.A.", - "B.A. (Bad Attitude!)", - "B.A. Barrakus", - "B.B.", - "B.B. Kat", - "B.B. King", - "B.B. Kingcat", - "B.C.", - "B.C. (\"Buttercup\")", - "B.C. (Big Cat)", - "B.D. (\"Black Douglas\", after the feisty Scottish warrior)", - "B.D. (Bad Boy)", - "B.D. (Brain-Dead)", - "B.D.K. (\"Buddy D. Katt\")", - "B.e.r.u. (Banana Emergency Recovery Unit, also Luke Skywalkers aunt and an island in the Pacific Ocean)", - "B.G.", - "B.I.F. (Butt In Face)", - "B.J.", - "B.J. (Tom Robbin's character Bonanza Jellybean)", - "B.K.", - "B.M.W. (Black, Mahogany & White)", - "B.O.T. (Big Old Tom)", - "B.u.d. (\"Big Ugly and Dumb\")", - "B.W.", - "B.W. (Black White)", - "BA", - "Ba Shaleek Alshain", - "Ba' Boy", - "Baba", - "Babaganoush", - "Babalou (after the tv show)", - "Babar", - "Babbaboombanorsh", - "Babbit", - "Babbitt", - "Babe", - "Babee", - "Babers", - "Babester", - "Babette", - "Babirusa", - "Baboo", - "Baboon Butt", - "Babricus", - "Babs (after Barbra Streisand)", - "Babsy", - "Babuji Braveheart", - "Babur", - "Babushka", - "Baby", - "Baby Bear", - "Baby Beauty", - "Baby Boogens", - "Baby Boy", - "Baby Bug", - "Baby Butterscotch", - "Baby Cakes", - "Baby Cat", - "Baby Doe (sort of a Jane Doe thang)", - "Baby Dog", - "Baby Doll", - "Baby Doo II", - "Baby Dumpling", - "Baby Girl", - "Baby Grey.", - "Baby Guiness", - "Baby Head", - "Baby Jane", - "Baby Jesus", - "Baby Ki'n", - "Baby Kitten", - "Baby Kitty", - "Baby Kitty And Trouble", - "Baby Mimi", - "Baby Nesbit", - "Baby Ruth", - "Baby Seebs", - "Baby Spice", - "Baby Weeeeeeezel the little Frrrrrench Chat", - "Baby-Boogs", - "Baby-Doll", - "Baby-Doo", - "Baby-Face", - "Baby-Kitty", - "Baby-Roca (named after two favorite candies, Baby Ruth and Almond Roca)", - "Babycakes", - "Babycat", - "Babydoll", - "Babyface", - "Babygray", - "Babykins", - "Babyman", - "Babyshoes", - "Babytat", - "Bacabs (Maya mythology: the canopic gods)", - "Bacall", - "Bacardi", - "Baccarat", - "Bacchos", - "Bacchus", - "Bacci (pronounced: Baa-chie; Italian for \"kisses\")", - "Bach", - "Baci", - "Back", - "Backstreet Blues", - "Backstreet Kitty", - "Bacon", - "Bad Bad Boy", - "Bad Bad Leroy Brown", - "Bad Bess", - "Bad Cat", - "Bad Kitty", - "Bad Luck", - "Bada", - "Badger", - "Badjun", - "Badlands", - "Badness", - "BadShad", - "Baeki", - "Bafftub", - "Bag", - "Bag Lady", - "Bag O'Cat", - "Bagel", - "Baggage", - "Baggi pants", - "Baggins", - "Baggy", - "Bagheera", - "Baghera (black panther in \"The Jungle Book\")", - "Baghreeah", - "Bagira", - "Bagoas", - "Bagpuss", - "Baguette", - "Bahama Mama", - "Bailey", - "Bailey Emerald Isle", - "Bailey's Irish Cream (50% sweetness and 50% nuts)", - "Bain", - "Bainbridge", - "Baja", - "Bajan", - "Baka (Japanese insult, \"idiot\", \"moron\", \"fool\", \"dimwit\")", - "Baka-Neko", - "Baker", - "Baker (after the mountain in North Carolina, USA)", - "Baksheesh (means \"bribe\" in Arabic)", - "Balaena", - "Balbina", - "Balboa", - "Balder (Viking mythology: The God of light)", - "Balderdash", - "Baldric", - "Baldrick", - "Baldur", - "Baldur The Fairly Slow", - "Baldwin", - "Baldy", - "Bali", - "Balik", - "Balin", - "Balki", - "Ballbearing Mouse Trap", - "Ballerina", - "Ballou", - "Ballsy", - "Baloo", - "Balraj", - "Balthazar", - "Balzac", - "Bam", - "Bam-Bam", - "Bama", - "Bambalona", - "Bambam", - "Bambi", - "Bambina", - "Bambino", - "Bamboo", - "Bamboozler", - "Bams", - "Bamse", - "Banana Cabana", - "Banana Peel", - "Band-Aid", - "Bandanna", - "Bandit", - "Bandito", - "Bang (reference to the Unix ! symbol)", - "Bangladesh", - "Bangle", - "Bangui (capital of Central African Republic)", - "Banjer", - "Banjo", - "Banjo Blue", - "Bannana Fanna", - "Bannenay", - "Banner", - "Banquet", - "Banquo", - "Banshee", - "Banzai", - "Bar Room", - "Baracca", - "Barbara", - "Barbara Bush", - "Barbarella (after the Jane Fonda movie)", - "Barbarian", - "Barbarino", - "Barbeque", -] - -// -// main.swift -// MeowPassword -// -// Created by Jeffrey Kunzelman on 8/23/25. -// - -import Foundation - -// MARK: - ASCII Art and Lolcat Theme -let lolcatArt = """ - __ - _,-;'''`'-,. - _/', `; `; `\\ - , _..,-'' ' ` ` `\\ - | ;._.,,-' .| |,_ ,, `\\ - | `;' ;' ;, `, ; | ' ' . \\ - `; __` ,'__ ` , ` ; | ; \\ - ; (6_); (6_) ; | , \\ ' | / - ;; _,' ,. ` `, ' `-._ | __//_________ - ,;.=..`_..=.,' -' ,'' _,--''------'''' -_pb__\\,`"=,,,=="',___,,,-----'''----'_'_'_''-;'' ------------------------''''''\\ \\''''' ) /' - `\\`,,,___/__/'_____, - `--,,,--,-,'''\\ - __,,-' /' ` - /'_,,--'' - | ( - `' - -""" - -// MARK: - Configuration Structure - -/** - * Configuration structure for password generation parameters - * Handles command-line argument parsing and parameter validation - */ -struct PasswordConfig { - let numNumbers: Int // Number of random numbers to insert (1-10) - let numSymbols: Int // Number of random symbols to insert (1-10) - let maxLength: Int // Maximum password length (15-50) - let showTests: Bool // Whether to run test mode - let copyToClipboard: Bool // Whether to copy result to clipboard - - /** - * Initialize configuration from command line arguments - * @param arguments: Array of command line arguments - */ - init(arguments: [String]) { - var numNumbers = Int.random(in: 3...5) // Default range as specified in requirements - var numSymbols = 2 // Default value as specified in requirements - var maxLength = 25 // Default max length as specified in requirements - var showTests = false - var copyToClipboard = false - - // Parse command line arguments with validation - for i in 0.. [String] { - // Read the embedded cat names from the generated Swift file - return embeddedCatNames -} - -/** - * Load cat names from embedded data (legacy interface for compatibility) - * This function maintains backward compatibility while using embedded data - * @param filePath: Ignored parameter - always uses embedded data - * @return Array of cat names from embedded data - */ -func loadCatNames(from filePath: String? = nil) -> [String] { - // Always use embedded cat names for production builds - return getEmbeddedCatNames() -} - -// MARK: - Cat Name Selection and Processing - -/** - * Select random cat names from the available pool - * @param catNames: Array of available cat names to choose from - * @param count: Number of names to select (will be clamped to available count) - * @return Array of randomly selected cat names - */ -func selectRandomCatNames(from catNames: [String], count: Int) -> [String] { - guard !catNames.isEmpty, count > 0 else { return [] } - - let actualCount = min(count, catNames.count) - return Array(catNames.shuffled().prefix(actualCount)) -} - -/** - * Create base phrase from selected cat names with length constraints - * Ensures the phrase meets the 15-25 character requirement from specifications - * @param catNames: Array of selected cat names to combine - * @param maxLength: Maximum allowed length for the phrase - * @return Base phrase string within specified length constraints - */ -func createBasePhrase(from catNames: [String], maxLength: Int) -> String { - let joinedNames = catNames.joined() - - // Ensure phrase is between 15 and maxLength characters as per specifications - if joinedNames.count < 15 { - // If too short, try adding more names to meet minimum length requirement - let additionalNames = selectRandomCatNames(from: catNames, count: 2) - let extended = joinedNames + additionalNames.joined() - return String(extended.prefix(maxLength)) - } else if joinedNames.count > maxLength { - return String(joinedNames.prefix(maxLength)) - } - - return joinedNames -} - -// MARK: - Password Security Transformations - -/** - * Randomly capitalize letters in the password array - * Implements the "3 letters randomly capitalized" requirement - * @param password: Mutable array of characters to modify - * @param count: Number of letters to capitalize (typically 3) - */ -func randomlyCapitalizeLetters(in password: inout [Character], count: Int) { - let letterIndices = password.enumerated().compactMap { index, char in - char.isLetter ? index : nil - } - - let indicesToCapitalize = Array(letterIndices.shuffled().prefix(count)) - - for index in indicesToCapitalize { - password[index] = Character(password[index].uppercased()) - } -} - -/** - * Insert random numbers into the password at random positions - * Implements the "3-5 numbers inserted randomly" requirement - * @param password: Mutable array of characters to modify - * @param count: Number of random numbers to insert - */ -func insertRandomNumbers(into password: inout [Character], count: Int) { - let numbers = "0123456789" - - for _ in 0..() - var previousChar: Character? - - for i in 0.. String { - // Step 1: Select 3-5 cat names - let nameCount = Int.random(in: 3...5) - let selectedNames = selectRandomCatNames(from: catNames, count: nameCount) - - // Step 2: Create base phrase - let basePhrase = createBasePhrase(from: selectedNames, maxLength: config.maxLength) - var password = Array(basePhrase.lowercased()) - - // Step 3: Apply security transformations - randomlyCapitalizeLetters(in: &password, count: 3) - insertRandomNumbers(into: &password, count: config.numNumbers) - replaceLettersWithSymbols(in: &password, count: config.numSymbols) - removeRepeatingLetters(in: &password) - - // Ensure final password doesn't exceed max length - if password.count > config.maxLength { - password = Array(password.prefix(config.maxLength)) - } - - return String(password) -} - -// MARK: - Kolmogorov Complexity Analysis -func calculateShannonEntropy(of string: String) -> Double { - let charCounts = string.reduce(into: [Character: Int]()) { counts, char in - counts[char, default: 0] += 1 - } - - let length = Double(string.count) - let entropy = charCounts.values.reduce(0.0) { result, count in - let probability = Double(count) / length - return result - (probability * log2(probability)) - } - - return entropy -} - -func calculateCompressionRatio(of string: String) -> Double { - // Simple run-length encoding approximation - var compressed = 0 - var previous: Character? - var runLength = 1 - - for char in string { - if char == previous { - runLength += 1 - } else { - compressed += runLength > 1 ? 2 : 1 - runLength = 1 - previous = char - } - } - compressed += runLength > 1 ? 2 : 1 - - return 1.0 - (Double(compressed) / Double(string.count)) -} - -func calculatePatternComplexity(of string: String) -> Double { - let substrings = getSubstrings(from: string, maxLength: 4) - let uniqueSubstrings = Set(substrings) - - if substrings.isEmpty { return 0.0 } - - return Double(uniqueSubstrings.count) / Double(substrings.count) -} - -func getSubstrings(from string: String, maxLength: Int) -> [String] { - let chars = Array(string) - var substrings: [String] = [] - - for length in 2...min(maxLength, chars.count) { - for start in 0...(chars.count - length) { - let substring = String(chars[start.. Double { - let uniqueChars = Set(string) - let hasLower = uniqueChars.contains { $0.isLowercase } - let hasUpper = uniqueChars.contains { $0.isUppercase } - let hasDigits = uniqueChars.contains { $0.isNumber } - let hasSymbols = uniqueChars.contains { !$0.isLetter && !$0.isNumber } - - let categories = [hasLower, hasUpper, hasDigits, hasSymbols].filter { $0 }.count - return Double(categories) / 4.0 -} - -func analyzeComplexity(of password: String) -> (score: Double, analysis: String) { - let entropy = calculateShannonEntropy(of: password) - let compressionRatio = calculateCompressionRatio(of: password) - let patternComplexity = calculatePatternComplexity(of: password) - let diversity = calculateCharacterDiversity(of: password) - - // Weighted complexity score - let score = (entropy * 0.3) + (compressionRatio * 0.25) + - (patternComplexity * 0.2) + (diversity * 0.15) + - (min(Double(password.count) / 25.0, 1.0) * 0.1) - - let finalScore = min(score, 10.0) - - let analysis = """ - Meow Complexity Analysis: - - Password: \(password) - - Tail Size: \(password.count) characters - - Ball of Yarn Entropy: \(String(format: "%.3f", entropy)) bits - - Mashing Resistance: \(String(format: "%.1f", compressionRatio * 100))% - - Shiny Foil Ball Uniqueness: \(String(format: "%.1f", patternComplexity * 100))% - - Catnip Diversity: \(String(format: "%.1f", diversity * 100))% - - Overall Relavency: \(String(format: "%.2f", finalScore))/10.0 - """ - - return (finalScore, analysis) -} - -// MARK: - Test Functions - -/** - * Helper function to assert test conditions and print results - * @param condition: Boolean condition to test - * @param message: Description of what is being tested - */ -func assert(_ condition: Bool, _ message: String) { - if condition { - print("PASS: \(message)") - } else { - print("FAIL: \(message)") - } -} - -/** - * Helper function to assert equality and print results - * @param actual: The actual value received - * @param expected: The expected value - * @param message: Description of what is being tested - */ -func assertEqual(_ actual: T, _ expected: T, _ message: String) { - if actual == expected { - print("PASS: \(message)") - } else { - print("FAIL: \(message) - Expected: \(expected), Got: \(actual)") - } -} - -/** - * Test the cat name loading functionality - * Verifies that embedded cat names are properly loaded and accessible - */ -func testLoadCatNames() { - print("\nTesting Cat Name Loading...") - - let catNames = loadCatNames() - assert(!catNames.isEmpty, "Should meow load cat names from embedded data") - assert(catNames.count > 100, "Should load a substantial meow number of cat names") - - let nonEmptyNames = catNames.filter { !$0.isEmpty } - assertEqual(nonEmptyNames.count, catNames.count, "All loaded meow names should be non-empty") - - // Test consistency of embedded loading - let embeddedNames = loadCatNames(from: nil) - assertEqual(embeddedNames.count, catNames.count, "Should return same meow count for embedded names") - - print("Cat names loaded meow: \(catNames.count)") - print("First few names: \(Array(catNames.prefix(5)))") -} - -/** - * Test the complete password generation process - * Validates that passwords meet all security requirements - */ -func testCompletePasswordGeneration() { - print("\nTesting Complete meow Password Generation...") - - let testNames = ["Fluffy", "Whiskers", "Shadow", "Mittens", "Tiger", "Luna", "Max", "Bella"] - let config = PasswordConfig(arguments: []) - - for i in 1...3 { - let password = generateSecurePassword(from: testNames, config: config) - - print("Generated password \(i): \(password)") - - assert(password.count >= 10, "Password meow should be at least 10 characters") - assert(password.count <= config.maxLength + 10, "Password should not greatly meow exceed max length") - - let hasNumbers = password.contains { $0.isNumber } - let hasLetters = password.contains { $0.isLetter } - let hasSymbols = password.contains { !$0.isLetter && !$0.isNumber } - - assert(hasNumbers, "Password should contain meow numbers") - assert(hasLetters, "Password should contain letters") - assert(hasSymbols, "Password should contain meow symbols") - - let (score, analysis) = analyzeComplexity(of: password) - assert(score >= 0.0 && score <= 10.0, "Complexity score should be meow valid") - assert(!analysis.isEmpty, "Analysis should not be meow empty") - } -} - -/** - * Run all basic tests for the MeowPassword system - * Executes comprehensive testing of all core functionality - */ -func runBasicTests() { - print("Running Basic meow MeowPassword Tests") - print("=================================") - - testLoadCatNames() - testCompletePasswordGeneration() - - print("\nBasic Tests meow Complete!") - print("=====================") -} - -// MARK: - Help Function - -/** - * Display help information for command-line usage - * Shows all available options and example usage - */ -func showHelp() { - print("MeowPassword - Lolcat-themed secure password generator") - print("") - print("Usage: meowpass [options]") - print("") - print("Options:") - print(" --numbers N Number of random numbers to insert (1-10, default: 3-5)") - print(" --symbols N Number of symbols to insert (1-10, default: 2)") - print(" --max-length N Maximum password length (15-50, default: 25)") - print(" --test Run tests") - print(" --copy Copy password to clipboard (macOS only)") - print(" --help Show this help message") - print("") - print("Examples:") - print(" meowpass") - print(" meowpass --numbers 4 --symbols 3 --max-length 30") - print(" meowpass --test") -} - -// MARK: - Main Program -func main() { - let config = PasswordConfig(arguments: CommandLine.arguments) - - // Check for help - if CommandLine.arguments.contains("--help") { - showHelp() - return - } - - // Check for test mode - if config.showTests { - runBasicTests() - return - } - - // Show ASCII art and title - print(lolcatArt) - print("MEOWPASSWORD - Lolcat Secure Password Generator") - print("===============================================") - - // Load cat names (now from embedded data) - let catNames = loadCatNames() - guard !catNames.isEmpty else { - print("ERROR: No cat names loaded from embedded data.") - return - } - - print("Loaded \(catNames.count) meow cat names") - print("Generating 5 secure password meow candidates...") - print("Config: \(config.numNumbers) numbers, \(config.numSymbols) symbols, max meow length \(config.maxLength)") - print("") - - // Generate 5 password candidates - var candidates: [(password: String, score: Double, analysis: String)] = [] - - for i in 1...5 { - let password = generateSecurePassword(from: catNames, config: config) - let (score, analysis) = analyzeComplexity(of: password) - candidates.append((password, score, analysis)) - - print("Candidate \(i): \(password)") - print(" Complexity meow Score: \(String(format: "%.2f", score))/10.0") - print("") - } - - // Select the most secure password - guard let bestCandidate = candidates.max(by: { $0.score < $1.score }) else { - print("ERROR: Could not meow select best password") - return - } - - print("MOST SECURE PASSWORD meow SELECTED:") - print("Password: \(bestCandidate.password)") - print("Final Meow Score: \(String(format: "%.2f", bestCandidate.score))/10.0") - print("") - print(bestCandidate.analysis) - - // Option to copy to clipboard (basic approach) - if config.copyToClipboard { - #if os(macOS) - let task = Process() - task.launchPath = "/usr/bin/pbcopy" - let pipe = Pipe() - task.standardInput = pipe - task.launch() - - pipe.fileHandleForWriting.write(bestCandidate.password.data(using: .utf8)!) - pipe.fileHandleForWriting.closeFile() - task.waitUntilExit() - - print("") - print("Password copied to clipboard!") - #else - print("") - print("Clipboard functionality only available on macOS") - #endif - } else { - print("") - print("Use 'meowpass --copy' to copy password to clipboard") - } -} - -// Run the program -main() -