Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 389b0a2

Browse files
Merge pull request avinashkranjan#941 from codebuzzer01/master
Cryptography
2 parents e91c8cd + fb45382 commit 389b0a2

17 files changed

+2955
-0
lines changed

‎Cryptography/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# CRYPTOGRAPHY
2+
3+
4+
## DESCRIPTION
5+
The objective of this project is to encode and decode messages using a common key. In this project, users have to enter the message to encode or decode. Users have to select the mode to choose the encoding and decoding process. The same key must be used to process the encoding and decoding for the same message.
6+
7+
8+
## PROJECT REQUISITES
9+
To build this project we will use the basic concept of python, Tkinter, and base64 library.
10+
11+
- Tkinter is a standard GUI python library.
12+
- base64 module provides a function to encode the binary data to ASCII characters and decode that ASCII characters back to binary data.
13+
- Tkinter is a standard GUI python library base64 module that provides a function to encode the binary data to ASCII characters and decode that ASCII characters back to binary data.
14+
15+
16+
## PROJECT STRUCTURE
17+
These are the step to build message encode – decode python project-
18+
19+
- Import module
20+
- Create display window
21+
- Define function
22+
- Define labels and buttons
23+
24+
25+
## AUTHOR NAME
26+
[ANUSHKA CHITRANSHI](https://github.com/codebuzzer01)

‎Cryptography/crypto.py

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
from tkinter import Tk
2+
from tkinter import Label
3+
from tkinter import BOTTOM
4+
from tkinter import StringVar
5+
from tkinter import Entry
6+
from tkinter import Button
7+
import base64
8+
9+
# initialize window
10+
root = Tk()
11+
root.geometry('500x300')
12+
root.resizable(0, 0)
13+
14+
# title of the window
15+
root.title("Cryptography World")
16+
17+
# label
18+
Label(root, text='ENCODE DECODE', font='arial 20 bold').pack()
19+
Label(root, text='By Anushka Chitranshi', font='arial 20 bold').pack(side=BOTTOM)
20+
21+
# define variables
22+
Text = StringVar()
23+
private_key = StringVar()
24+
mode = StringVar()
25+
Result = StringVar()
26+
27+
28+
# function to encode
29+
def Encode(key, message):
30+
"""Encode the message."""
31+
enc = []
32+
for i in enumerate(message):
33+
key_c = key[i % len(key)]
34+
enc.append(chr((ord(message[i]) + ord(key_c)) % 256))
35+
return base64.urlsafe_b64encode("".join(enc).encode()).decode()
36+
37+
38+
# function to decode
39+
def Decode(key, message):
40+
"""Decode the message."""
41+
dec = []
42+
message = base64.urlsafe_b64decode(message).decode()
43+
for i in enumerate(message):
44+
key_c = key[i % len(key)]
45+
dec.append(chr((256 + ord(message[i]) - ord(key_c)) % 256))
46+
return "".join(dec)
47+
48+
49+
# function to set mode
50+
def Mode():
51+
"""Take mode of cryptography."""
52+
if mode.get() == 'e':
53+
Result.set(Encode(private_key.get(), Text.get()))
54+
elif mode.get() == 'd':
55+
Result.set(Decode(private_key.get(), Text.get()))
56+
else:
57+
Result.set('Invalid Mode')
58+
59+
60+
# Function to exit window
61+
def Exit():
62+
"""Exit the window."""
63+
root.destroy()
64+
65+
66+
# Function to reset
67+
def Reset():
68+
"""Reset the screen."""
69+
Text.set("")
70+
private_key.set("")
71+
mode.set("")
72+
Result.set("")
73+
74+
75+
Label(
76+
root, font='arial 12 bold', text='MESSAGE'
77+
).place(x=60, y=60)
78+
Entry(
79+
root, font='arial 10', textvariable=Text, bg='ghost white'
80+
).place(x=290, y=60)
81+
82+
83+
# key
84+
Label(root, font='arial 12 bold', text='KEY').place(x=60, y=90)
85+
Entry(
86+
root, font='arial 10', textvariable=private_key , bg='ghost white'
87+
).place(x=290, y=90)
88+
89+
# mode
90+
Label(
91+
root, font='arial 12 bold', text='MODE(e-encode, d-decode)'
92+
).place(x=60, y=120)
93+
Entry(
94+
root, font='arial 10', textvariable=mode , bg='ghost white'
95+
).place(x=290, y=120)
96+
97+
# result
98+
Entry(
99+
root, font='arial 10 bold', textvariable=Result, bg='ghost white'
100+
).place(x=290, y=150)
101+
102+
# result button
103+
Button(
104+
root, font='arial 10 bold', text='RESULT', padx=2, bg='LightGray', command=Mode
105+
).place(x=60, y=150)
106+
107+
# reset button
108+
Button(
109+
root, font='anson', text='RESET', width=6, command=Reset, bg='Green', padx=2
110+
).place(x=80, y=190)
111+
112+
# exit button
113+
Button(
114+
root, font='anson', text='EXIT', width=6, command=Exit, bg='Red', padx=2, pady=2
115+
).place(x=180, y=190)
116+
root.mainloop()

‎Gender-Age Detection/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# GENDER-AGE DETECTION
2+
3+
## DESCRIPTION
4+
5+
The objective of this project is to identify the gender and approximate age of a person given in an image automatically.
6+
7+
## PROJECT REQUISITES
8+
9+
To build this project we will use
10+
11+
- Deep Learning to accurately identify the gender and age of a person from a single image of a face.
12+
- We will use this [dataset](https://www.kaggle.com/ttungl/adience-benchmark-gender-and-age-classification)
13+
- The predicted gender may be one of ‘Male’ and ‘Female’, and the predicted age may be one of the following 8 ranges- (0 – 2), (4 – 6), (8 – 12), (15 – 20), (25 – 32), (38 – 43), (48 – 53), (60 – 100).
14+
15+
## PROJECT STRUCTURE
16+
17+
These are the step to build Gender-Age Detection python project-
18+
19+
- Detect faces
20+
- Classify into Male/Female
21+
- Classify into one of the 8 age ranges
22+
- Put the results on the image and display it
23+
24+
## AUTHOR NAME
25+
26+
[ANUSHKA CHITRANSHI](https://github.com/codebuzzer01)
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: "CaffeNet"
2+
input: "data"
3+
input_dim: 1
4+
input_dim: 3
5+
input_dim: 227
6+
input_dim: 227
7+
layers {
8+
name: "conv1"
9+
type: CONVOLUTION
10+
bottom: "data"
11+
top: "conv1"
12+
convolution_param {
13+
num_output: 96
14+
kernel_size: 7
15+
stride: 4
16+
}
17+
}
18+
layers {
19+
name: "relu1"
20+
type: RELU
21+
bottom: "conv1"
22+
top: "conv1"
23+
}
24+
layers {
25+
name: "pool1"
26+
type: POOLING
27+
bottom: "conv1"
28+
top: "pool1"
29+
pooling_param {
30+
pool: MAX
31+
kernel_size: 3
32+
stride: 2
33+
}
34+
}
35+
layers {
36+
name: "norm1"
37+
type: LRN
38+
bottom: "pool1"
39+
top: "norm1"
40+
lrn_param {
41+
local_size: 5
42+
alpha: 0.0001
43+
beta: 0.75
44+
}
45+
}
46+
layers {
47+
name: "conv2"
48+
type: CONVOLUTION
49+
bottom: "norm1"
50+
top: "conv2"
51+
convolution_param {
52+
num_output: 256
53+
pad: 2
54+
kernel_size: 5
55+
}
56+
}
57+
layers {
58+
name: "relu2"
59+
type: RELU
60+
bottom: "conv2"
61+
top: "conv2"
62+
}
63+
layers {
64+
name: "pool2"
65+
type: POOLING
66+
bottom: "conv2"
67+
top: "pool2"
68+
pooling_param {
69+
pool: MAX
70+
kernel_size: 3
71+
stride: 2
72+
}
73+
}
74+
layers {
75+
name: "norm2"
76+
type: LRN
77+
bottom: "pool2"
78+
top: "norm2"
79+
lrn_param {
80+
local_size: 5
81+
alpha: 0.0001
82+
beta: 0.75
83+
}
84+
}
85+
layers {
86+
name: "conv3"
87+
type: CONVOLUTION
88+
bottom: "norm2"
89+
top: "conv3"
90+
convolution_param {
91+
num_output: 384
92+
pad: 1
93+
kernel_size: 3
94+
}
95+
}
96+
layers{
97+
name: "relu3"
98+
type: RELU
99+
bottom: "conv3"
100+
top: "conv3"
101+
}
102+
layers {
103+
name: "pool5"
104+
type: POOLING
105+
bottom: "conv3"
106+
top: "pool5"
107+
pooling_param {
108+
pool: MAX
109+
kernel_size: 3
110+
stride: 2
111+
}
112+
}
113+
layers {
114+
name: "fc6"
115+
type: INNER_PRODUCT
116+
bottom: "pool5"
117+
top: "fc6"
118+
inner_product_param {
119+
num_output: 512
120+
}
121+
}
122+
layers {
123+
name: "relu6"
124+
type: RELU
125+
bottom: "fc6"
126+
top: "fc6"
127+
}
128+
layers {
129+
name: "drop6"
130+
type: DROPOUT
131+
bottom: "fc6"
132+
top: "fc6"
133+
dropout_param {
134+
dropout_ratio: 0.5
135+
}
136+
}
137+
layers {
138+
name: "fc7"
139+
type: INNER_PRODUCT
140+
bottom: "fc6"
141+
top: "fc7"
142+
inner_product_param {
143+
num_output: 512
144+
}
145+
}
146+
layers {
147+
name: "relu7"
148+
type: RELU
149+
bottom: "fc7"
150+
top: "fc7"
151+
}
152+
layers {
153+
name: "drop7"
154+
type: DROPOUT
155+
bottom: "fc7"
156+
top: "fc7"
157+
dropout_param {
158+
dropout_ratio: 0.5
159+
}
160+
}
161+
layers {
162+
name: "fc8"
163+
type: INNER_PRODUCT
164+
bottom: "fc7"
165+
top: "fc8"
166+
inner_product_param {
167+
num_output: 8
168+
}
169+
}
170+
layers {
171+
name: "prob"
172+
type: SOFTMAX
173+
bottom: "fc8"
174+
top: "prob"
175+
}

‎Gender-Age Detection/age_net.caffemodel

43.5 MB
Binary file not shown.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /