Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Password_Manager/backup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yash:@@/TC:s::Google:email:Riya:4u
/:wC U0 :shivam::25#E[,:Instageam:email:Riya:<M=-T[1:whatshaap:social
50 changes: 50 additions & 0 deletions Password_Manager/lang_support.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import numpy as np
import regex as re
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import statistics
import math
import os

from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split

import tensorflow as tf
import tensorflow.keras.backend as K
import tokenizers
from transformers import RobertaTokenizer, TFRobertaModel

from collections import Counter

import warnings
warnings.filterwarnings("ignore")

# Detect hardware, return appropriate distribution strategy (you can see that it is pretty easy to set up).
try:
# TPU detection. No parameters necessary if TPU_NAME environment variable is set (always set in Kaggle)
tpu = tf.distribute.cluster_resolver.TPUClusterResolver()
tf.config.experimental_connect_to_cluster(tpu)
tf.tpu.experimental.initialize_tpu_system(tpu)
strategy = tf.distribute.experimental.TPUStrategy(tpu)
print('Running on TPU ', tpu.master())
except ValueError:
# Default distribution strategy in Tensorflow. Works on CPU and single GPU.
strategy = tf.distribute.get_strategy()

print('Number of replicas:', strategy.num_replicas_in_sync)

MODEL_NAME = 'roberta-base'
MAX_LEN = 256
ARTIFACTS_PATH = '../artifacts/'

BATCH_SIZE = 8 * strategy.num_replicas_in_sync
EPOCHS = 3

if not os.path.exists(ARTIFACTS_PATH):
os.makedirs(ARTIFACTS_PATH)




Binary file added Password_Manager/main
Binary file not shown.
211 changes: 211 additions & 0 deletions Password_Manager/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <sys/stat.h>
#include <sys/types.h>

using namespace std;

// Encryption key
const string ENCRYPTION_KEY = "my_encryption_key";
const string BACKUP_FILE = "backup.txt";
const string PASSWORDS_FILE = "passwords.txt";

// Structure to store account information
struct Account {
string username;
string password;
string website;
string category; // Added category field
};

// Function to generate a random password of specified length
string generatePassword(int length) {
string password = "";
const string characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()-_=+";
int charLength = characters.length();

srand(time(0));
for (int i = 0; i < length; ++i) {
int index = rand() % charLength;
password += characters[index];
}

return password;
}

// Function to encrypt the password
string encryptPassword(const string& password) {
string encryptedPassword = password;
const string& ENCRYPTION_KEY = "my_encryption_key"; // Moved to local scope
for (int i = 0; i < password.length(); ++i) {
encryptedPassword[i] ^= ENCRYPTION_KEY[i % ENCRYPTION_KEY.length()];
}
return encryptedPassword;
}

// Function to store the account in a secure manner
void storeAccount(const string& username, const string& password, const string& website, const string& category) {
// Encrypt the password before storing it
string encryptedPassword = encryptPassword(password);

ofstream outfile(PASSWORDS_FILE, ios::app);
if (!outfile.is_open()) {
cerr << "Error: Could not open passwords.txt for writing." << endl;
return;
}
outfile << username << ":" << encryptedPassword << ":" << website << ":" << category << endl;
outfile.close();
}

// Function to decrypt the password
string decryptPassword(const string& encryptedPassword) {
string decryptedPassword = encryptedPassword;
const string& ENCRYPTION_KEY = "my_encryption_key"; // Moved to local scope
for (int i = 0; i < encryptedPassword.length(); ++i) {
decryptedPassword[i] ^= ENCRYPTION_KEY[i % ENCRYPTION_KEY.length()];
}
return decryptedPassword;
}

// Function to read and decrypt accounts from file
vector<Account> readAccounts() {
vector<Account> accounts;
ifstream infile(PASSWORDS_FILE);
if (!infile.is_open()) {
cerr << "Error: Could not open passwords.txt for reading." << endl;
return accounts;
}
string username, encryptedPassword, website, category;
while (infile >> username >> encryptedPassword >> website >> category) {
Account account;
account.username = username;
account.password = decryptPassword(encryptedPassword);
account.website = website;
account.category = category;
accounts.push_back(account);
}
infile.close();
return accounts;
}

// Function to validate the password strength
bool validatePassword(const string& password) {
// Password should have at least 8 characters
if (password.length() < 8) {
return false;
}

// Password should contain at least one uppercase letter, one lowercase letter, one digit, and one special character
bool hasUpper = false, hasLower = false, hasDigit = false, hasSpecial = false;
for (char c : password) {
if (isupper(c)) hasUpper = true;
if (islower(c)) hasLower = true;
if (isdigit(c)) hasDigit = true;
if (!isalnum(c)) hasSpecial = true;
}

return hasUpper && hasLower && hasDigit && hasSpecial;
}

// Function to backup password data
void backupData() {
// Read current data
vector<Account> accounts = readAccounts();

// Write data to backup file
ofstream outfile(BACKUP_FILE);
if (!outfile.is_open()) {
cerr << "Error: Could not open " << BACKUP_FILE << " for writing." << endl;
return;
}
for (const auto& account : accounts) {
outfile << account.username << ":" << account.password << ":" << account.website << ":" << account.category << endl;
}
outfile.close();

cout << "Data backed up to " << BACKUP_FILE << endl;
}

// Function to restore password data from backup
void restoreData() {
// Read data from backup file
ifstream infile(BACKUP_FILE);
if (!infile.is_open()) {
cerr << "Error: Could not open " << BACKUP_FILE << " for reading." << endl;
return;
}
string username, password, website, category;
while (infile >> username >> password >> website >> category) {
storeAccount(username, password, website, category);
}
infile.close();

cout << "Data restored from " << BACKUP_FILE << endl;
}

// Function to prompt the user to enter a valid password
string getValidPassword() {
while (true) {
cout << "Enter your password: ";
string password;
cin >> password;

if (validatePassword(password)) {
return password;
} else {
cout << "Password is weak. It should have at least 8 characters, one uppercase, one lowercase, one digit, and one special character." << endl;
}
}
}

int main() {
int passwordLength;
string username, password, website, category;

cout << "Enter your username: ";
cin >> username;

// Generate a password if the user wants to
char generate;
cout << "Do you want to generate a password? (Y/N): ";
cin >> generate;
if (generate == 'Y' || generate == 'y') {
cout << "Enter the desired length of your password: ";
cin >> passwordLength;
password = generatePassword(passwordLength);
cout << "Generated password: " << password << endl;
} else {
password = getValidPassword(); // Use the new function to get a valid password
}

cout << "Enter the website: ";
cin >> website;

cout << "Enter the category (e.g., email, social, finance): ";
cin >> category;

storeAccount(username, password, website, category);
cout << "Account saved securely." << endl;

cout << "Decrypting and reading stored accounts:" << endl;
vector<Account> accounts = readAccounts();
for (const auto& account : accounts) {
cout << "Website: " << account.website << ", Username: " << account.username << ", Password: " << account.password << ", Category: " << account.category << endl;
}

// Backup and restore functionality
char backupRestore;
cout << "Do you want to backup (B) or restore (R) data? (B/R): ";
cin >> backupRestore;
if (backupRestore == 'B' || backupRestore == 'b') {
backupData();
} else if (backupRestore == 'R' || backupRestore == 'r') {
restoreData();
}

return 0;
}
5 changes: 5 additions & 0 deletions Password_Manager/passwords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
yash:@@/TC  :Google:email
Riya:4u / :Instagram:social
shivam::25#E[,:Instageam:email
Riya:<M=-T[1:whatshaap:social
Riya:G1::^QGJ :instagram:social
Expand Down
1 change: 1 addition & 0 deletions Password_Manager/t
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

57 changes: 57 additions & 0 deletions Property Website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<div align="center">

![GitHub repo size](https://img.shields.io/github/repo-size/codewithsadee/homeverse)
![GitHub stars](https://img.shields.io/github/stars/codewithsadee/homeverse?style=social)
![GitHub forks](https://img.shields.io/github/forks/codewithsadee/homeverse?style=social)
[![Twitter Follow](https://img.shields.io/twitter/follow/codewithsadee_?style=social)](https://twitter.com/intent/follow?screen_name=codewithsadee_)
[![YouTube Video Views](https://img.shields.io/youtube/views/6HZ4nZmU_pE?style=social)](https://youtu.be/6HZ4nZmU_pE)

<br />
<br />

<img src="./readme-images/project-logo.png" />

<h2 align="center">Homeverse - Real estate website</h2>

Homeverse is fully responsive Real estate website, <br />Responsive for all devices, built using HTML, CSS, and JavaScript.

<a href="https://codewithsadee.github.io/homeverse/"><strong>➥ Live Demo</strong></a>

</div>

<br />

### Demo Screeshots

![homeverse Desktop Demo](./readme-images/desktop.png "Desktop Demo")
![homeverse Mobile Demo](./readme-images/mobile.png "Mobile Demo")

### Prerequisites

Before you begin, ensure you have met the following requirements:

* [Git](https://git-scm.com/downloads "Download Git") must be installed on your operating system.

### Run Locally

To run **Homeverse** locally, run this command on your git bash:

Linux and macOS:

```bash
sudo git clone https://github.com/codewithsadee/homeverse.git
```

Windows:

```bash
git clone https://github.com/codewithsadee/homeverse.git
```

### Contact

If you want to contact with me you can reach me at [Twitter](https://www.twitter.com/codewithsadee).

### License

This project is **free to use** and does not contains any license.
9 changes: 9 additions & 0 deletions Property Website/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading