ATtiny85 Based Password Cracking

 Title: ATtiny85 Based Password Cracking


Introduction:

    In this Blog, we'll explore how to use the ATtiny85 microcontroller for a simple password cracking project. This project will help you understand basic electronics and microcontroller programming while working on a practical application.


Materials Needed:

1. ATtiny85 microcontroller

2. Breadboard and jumper wires

3. Resistors (10kΩ, 220Ω)

4. Push buttons

5. LEDs

6. 16 MHz crystal oscillator

7. Capacitors (22pF)

8. USBasp programmer

9. Arduino IDE (for programming)


Step 1: Setting Up the ATtiny85

1. Install ATtiny85 Support in Arduino IDE:

   - Open Arduino IDE.

   - Go to `File` > `Preferences`.

   - In the "Additional Boards Manager URLs" field, add: `http://drazzy.com/package_drazzy.com_index.json`.

   - Go to `Tools` > `Board` > `Boards Manager`.

   - Search for `ATtiny` and install the "ATtinyCore" package.


2. Connect the ATtiny85 to Your Computer:

   - Use the USBasp programmer.

   - Connect the programmer to the ATtiny85 following the pinout diagram.


Step 2: Wiring the Circuit

1. Connect the Crystal Oscillator:

   - Place the 16 MHz crystal oscillator on the breadboard.

   - Connect it to the ATtiny85's pins 2 and 3.

   - Add 22pF capacitors between the oscillator pins and ground.


2. Add Push Buttons and LEDs:

   - Connect push buttons to pins PB0 and PB1 of the ATtiny85.

   - Connect LEDs to pins PB2 and PB3 with a 220Ω resistor in series.


Step 3: Writing the Password Cracking Code

1. Open Arduino IDE and Create a New Sketch:


#include <avr/io.h>

#include <util/delay.h>

#define LED1 PB2

#define LED2 PB3

#define BUTTON1 PB0

#define BUTTON2 PB1

void setup() {

    // Set LEDs as output

    DDRB |= (1 << LED1) | (1 << LED2);

    // Set buttons as input with pull-up resistors

    DDRB &= ~(1 << BUTTON1) & ~(1 << BUTTON2);

    PORTB |= (1 << BUTTON1) | (1 << BUTTON2);

}

void loop() {

    // Basic password cracking logic (dummy example)

    for (uint8_t i = 0; i < 256; i++) {

        if ((PINB & (1 << BUTTON1)) == 0) {

            // Simulate password check

            PORTB |= (1 << LED1);  // Turn on LED1 for a correct password

            _delay_ms(1000);

            PORTB &= ~(1 << LED1); // Turn off LED1

        }

        if ((PINB & (1 << BUTTON2)) == 0) {

            PORTB |= (1 << LED2);  // Turn on LED2 for a wrong password

            _delay_ms(1000);

            PORTB &= ~(1 << LED2); // Turn off LED2

        }

    }

}


2. Upload the Code to the ATtiny85:

   - Select `Tools` > `Board` > `ATtiny85`.

   - Choose the correct clock frequency and other settings.

   - Click on `Upload`.


Step 4: Testing the Project


1. Power the Circuit:

   - Connect a 5V power supply to the ATtiny85. 


2. Test Button Functionality:

   - Press the push buttons to simulate password entry.

   - Observe the LEDs as they indicate correct or incorrect entries based on the code logic.


Conclusion:

    You have successfully created a basic password cracking project using the ATtiny85. This project serves as an introduction to microcontroller programming and electronic circuits. Experiment with the code and hardware to enhance your understanding and create more complex projects.


Further Reading

    - ATtiny85 Datasheet

    - Arduino Programming Basics

    - Electronics for Beginners



Comments

Popular Posts