Skip to content

Commit 6332893

Browse files
authored
Add files via upload
1 parent 9c45952 commit 6332893

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1530
-0
lines changed

debian/changelog

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
enco (1.0-1) unstable; urgency=medium
2+
3+
* Initial release.
4+
5+
-- Fatih Önder <[email protected]> Thu, 22 Nov 2024 10:00:00 +0300
6+

debian/compat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7

debian/control

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Source: enco
2+
Section: python
3+
Priority: optional
4+
Maintainer: Fatih ÖNDER <[email protected]>
5+
Build-Depends: debhelper (>= 10), python3-all, dh-python
6+
Standards-Version: 4.1.5
7+
Homepage: https://algyazilim.com
8+
9+
Package: enco
10+
Architecture: all
11+
Depends: python3, python3-pyqt5, python3-cryptography
12+
Description: EnCo - Dosya kilitleme ve Çözme Aracı
13+
EnCo, dosyalarınızı güvenli (AES256) bir şekilde kilitleytip çözmenize olanak tanıyan bir Python uygulamasıdır.

debian/copyright

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: enco
3+
Source: https://github.com/cektor/EnCo
4+
5+
Files: *
6+
Copyright:Fatih ÖNDER (CekToR) 2024 ALG Yazılım Inc.
7+
License: GNU
8+

debian/enco.debhelper.log

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
dh_update_autotools_config
2+
dh_auto_configure
3+
dh_auto_build
4+
dh_auto_test
5+
dh_prep
6+
dh_auto_install
7+
dh_install
8+
dh_install
9+
dh_installdocs
10+
dh_installchangelogs
11+
dh_installinit
12+
dh_icons
13+
dh_perl
14+
dh_link
15+
dh_strip_nondeterminism
16+
dh_compress
17+
dh_fixperms
18+
dh_missing
19+
dh_installdeb
20+
dh_gencontrol
21+
dh_md5sums
22+
dh_builddeb

debian/enco.desktop

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Version=1.0
3+
Name=EnCo
4+
Comment=EnCo Application
5+
Exec=python3 /usr/bin/enco.py
6+
Icon=/usr/share/icons/hicolor/48x48/apps/encolo.png
7+
Terminal=false
8+
Type=Application
9+
Categories=Utility
10+
11+
Name[tr_TR]=EnCo

debian/enco.substvars

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
misc:Depends=
2+
misc:Pre-Depends=

debian/enco/DEBIAN/control

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Package: enco
2+
Version: 1.0-1
3+
Architecture: all
4+
Maintainer: Fatih ÖNDER <[email protected]>
5+
Installed-Size: 103
6+
Depends: python3, python3-pyqt5, python3-cryptography
7+
Section: python
8+
Priority: optional
9+
Homepage: https://algyazilim.com
10+
Description: EnCo - Dosya kilitleme ve Çözme Aracı
11+
EnCo, dosyalarınızı güvenli (AES256) bir şekilde kilitleytip çözmenize olanak tanıyan bir Python uygulamasıdır.

debian/enco/DEBIAN/md5sums

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dadbd5173d4fc14c0d024eb616bfda94 usr/bin/enco.py
2+
71e3bda0549d18ffd3a756d348baeef1 usr/lib/python3.11/dist-packages/enco-1.0.egg-info/PKG-INFO
3+
68b329da9893e34099c7d8ad5cb9c940 usr/lib/python3.11/dist-packages/enco-1.0.egg-info/dependency_links.txt
4+
68b329da9893e34099c7d8ad5cb9c940 usr/lib/python3.11/dist-packages/enco-1.0.egg-info/top_level.txt
5+
06c231ecb083d3020aa2ab3e718d89ec usr/share/applications/enco.desktop
6+
8c71cce126c3f40031967ad1dbdd5dbd usr/share/doc/enco/changelog.Debian.gz
7+
88aabe9c4f2dadb579d43d5dbf12490b usr/share/doc/enco/copyright
8+
911ee3daf995fcb46179eec94da1b71d usr/share/icons/hicolor/48x48/apps/encolo.png
9+
911ee3daf995fcb46179eec94da1b71d usr/~/.local/share/encolo.png

debian/enco/usr/bin/enco.py

+253
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QPushButton, QFileDialog, QLabel, QMenu, QInputDialog, QFrame, QDialog, QAction
2+
from PyQt5.QtGui import QPixmap, QFont, QIcon
3+
from PyQt5.QtCore import Qt, QPoint, QUrl
4+
import os
5+
import base64
6+
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
7+
from cryptography.hazmat.primitives.hashes import SHA256
8+
from cryptography.fernet import Fernet
9+
import sys
10+
11+
SALT = b'some_salt_value' # Şifre türetmek için sabit bir salt kullanılıyor.
12+
13+
def get_logo_path():
14+
# PyInstaller ile paketlendiğinde kullanılan yol
15+
if hasattr(sys, "_MEIPASS"):
16+
return os.path.join(sys._MEIPASS, "encolo.png")
17+
# Sabit bir sistem yolu
18+
elif os.path.exists("/usr/share/icons/hicolor/48x48/apps/encolo.png"):
19+
return "/usr/share/icons/hicolor/48x48/apps/encolo.png"
20+
home_dir = os.path.expanduser("/usr/share/icons/hicolor/48x48/apps/encolo.png")
21+
if os.path.exists(home_dir):
22+
return home_dir
23+
# Varsayılan olarak bulunduğu dizindeki encolo.png
24+
return "encolo.png"
25+
26+
# Logo dosyasının yolu
27+
logo_path = get_logo_path()
28+
29+
def derive_key(password: str) -> bytes:
30+
"""Kullanıcı tarafından girilen şifreye göre bir anahtar türetir."""
31+
kdf = PBKDF2HMAC(
32+
algorithm=SHA256(),
33+
length=32,
34+
salt=SALT,
35+
iterations=100000,
36+
)
37+
return base64.urlsafe_b64encode(kdf.derive(password.encode()))
38+
39+
class FileEncryptionApp(QMainWindow):
40+
def __init__(self):
41+
super().__init__()
42+
self.setWindowTitle("EnCo Dosya Kilitle/Çöz")
43+
self.setWindowIcon(QIcon(logo_path)) # Uygulama simgesi
44+
self.setGeometry(300, 200, 600, 400)
45+
self.setFixedSize(350, 450)
46+
self.key = None
47+
self.setStyleSheet("background-color: #2D2F31; color: #FFD24C;")
48+
self.setWindowOpacity(0.9) # %80 şeffaflık
49+
self.initUI()
50+
51+
def initUI(self):
52+
self.central_widget = QWidget()
53+
self.setCentralWidget(self.central_widget)
54+
55+
layout = QVBoxLayout()
56+
57+
# Logo kısmı
58+
self.logo_label = QLabel(self)
59+
pixmap = QPixmap(logo_path) # Logoyu yüklüyoruz
60+
self.logo_label.setPixmap(pixmap)
61+
self.logo_label.setAlignment(Qt.AlignCenter)
62+
self.logo_label.setFixedHeight(100) # Logo yüksekliği
63+
64+
self.label = QLabel("Dosya seçilmedi.")
65+
self.label.setFont(QFont("Arial", 12))
66+
self.label.setAlignment(Qt.AlignCenter)
67+
68+
button_layout = QVBoxLayout()
69+
self.encrypt_button = self.create_button("🔒 Dosyayı Kilitle", self.encrypt_file)
70+
self.decrypt_button = self.create_button("🔑 Dosyayı Çöz", self.decrypt_file)
71+
72+
button_layout.addWidget(self.encrypt_button)
73+
button_layout.addWidget(self.decrypt_button)
74+
75+
self.drop_frame = QFrame(self)
76+
self.drop_frame.setFrameShape(QFrame.StyledPanel)
77+
self.drop_frame.setStyleSheet("background-color: #FF967615; border-radius: 10px; height: 200px; margin: 20px;")
78+
self.drop_frame.setAcceptDrops(True) # Sürükle-bırak etkinleştirildi
79+
self.drop_frame.setObjectName("drop_frame")
80+
81+
self.drop_label = QLabel("Dosyayı Sürükle Bırak", self.drop_frame)
82+
self.drop_label.setAlignment(Qt.AlignCenter)
83+
self.drop_label.setFont(QFont("Arial", 13))
84+
self.drop_label.setStyleSheet("color: white;")
85+
86+
self.click_to_select_label = QLabel("Dosya Seçmek İçin Tıklayınız.", self.drop_frame)
87+
self.click_to_select_label.setAlignment(Qt.AlignCenter)
88+
self.click_to_select_label.setFont(QFont("Arial", 9))
89+
self.click_to_select_label.setStyleSheet("color: #A9A9A9;")
90+
91+
self.drop_frame.setLayout(QVBoxLayout())
92+
self.drop_frame.layout().addWidget(self.drop_label)
93+
self.drop_frame.layout().addWidget(self.click_to_select_label)
94+
self.drop_frame.layout().setContentsMargins(0, 0, 0, 0)
95+
96+
layout.addWidget(self.logo_label)
97+
layout.addWidget(self.label)
98+
layout.addWidget(self.drop_frame)
99+
layout.addLayout(button_layout)
100+
101+
self.central_widget.setLayout(layout)
102+
103+
self.menu_button = QPushButton("⋮", self)
104+
self.menu_button.setStyleSheet("""
105+
font-size: 20px;
106+
background-color: #2D2F31;
107+
color: #FFD24C;
108+
border: none;
109+
padding: 10px;
110+
""")
111+
self.menu_button.setFixedSize(40, 40)
112+
self.menu_button.clicked.connect(self.show_menu)
113+
self.menu_button.move(self.width() - 50, 20)
114+
115+
self.file_path = None
116+
117+
# Tıklama ile dosya seçme işlevi
118+
self.drop_frame.mousePressEvent = self.select_file_on_click
119+
120+
def create_button(self, text: str, action):
121+
button = QPushButton(text)
122+
button.setStyleSheet("""
123+
background-color: #FFA6841E;
124+
color: #2D2F31;
125+
font-size: 14px;
126+
border-radius: 10px;
127+
padding: 10px;
128+
margin: 10px;
129+
width: 200px;
130+
""")
131+
button.clicked.connect(action)
132+
button.setFixedHeight(60)
133+
return button
134+
135+
def select_file(self):
136+
file_dialog = QFileDialog()
137+
file_path, _ = file_dialog.getOpenFileName(self, "Bir dosya seçin")
138+
if file_path:
139+
self.file_path = file_path
140+
self.label.setText(f"Seçilen Dosya: {os.path.basename(file_path)}")
141+
142+
def select_file_on_click(self, event):
143+
self.select_file()
144+
145+
def ask_password(self) -> str:
146+
password, ok = QInputDialog.getText(self, "Parola Girin", "Parola (4-64 karakter):")
147+
if ok and 4 <= len(password) <= 64:
148+
return password
149+
elif ok:
150+
self.label.setText("Parola uzunluğu 4-64 karakter arasında olmalıdır!")
151+
return None
152+
153+
def encrypt_file(self):
154+
if not self.file_path:
155+
self.label.setText("Lütfen bir dosya seçin!")
156+
return
157+
158+
password = self.ask_password()
159+
if not password:
160+
return
161+
162+
self.key = derive_key(password)
163+
cipher = Fernet(self.key)
164+
165+
try:
166+
with open(self.file_path, "rb") as file:
167+
data = file.read()
168+
169+
encrypted_data = cipher.encrypt(data)
170+
encrypted_path = f"{self.file_path}.enco"
171+
172+
with open(encrypted_path, "wb") as file:
173+
file.write(encrypted_data)
174+
175+
os.remove(self.file_path)
176+
self.file_path = encrypted_path
177+
self.label.setText(f"Kilitleme tamamlandı: {os.path.basename(encrypted_path)}")
178+
179+
except Exception as e:
180+
self.label.setText(f"Hata: {str(e)}")
181+
182+
def decrypt_file(self):
183+
if not self.file_path or not self.file_path.endswith(".enco"):
184+
self.label.setText("Lütfen bir kilitlenmiş dosya seçin!")
185+
return
186+
187+
password = self.ask_password()
188+
if not password:
189+
return
190+
191+
self.key = derive_key(password)
192+
cipher = Fernet(self.key)
193+
194+
try:
195+
with open(self.file_path, "rb") as file:
196+
encrypted_data = file.read()
197+
198+
decrypted_data = cipher.decrypt(encrypted_data)
199+
original_path = self.file_path.rsplit(".enco", 1)[0]
200+
201+
with open(original_path, "wb") as file:
202+
file.write(decrypted_data)
203+
204+
os.remove(self.file_path)
205+
self.file_path = original_path
206+
self.label.setText(f"Çözme tamamlandı: {os.path.basename(original_path)}")
207+
208+
except Exception as e:
209+
self.label.setText(f"Hata: {str(e)}")
210+
211+
def dragEnterEvent(self, event):
212+
"""Sürüklenen öğe, dosya ise kabul edilir."""
213+
if event.mimeData().hasUrls():
214+
event.acceptProposedAction()
215+
216+
def dropEvent(self, event):
217+
"""Sürükle bırak işlemi gerçekleştiğinde dosya yolu alır."""
218+
file_path = event.mimeData().urls()[0].toLocalFile()
219+
self.file_path = file_path
220+
self.label.setText(f"Seçilen Dosya: {os.path.basename(file_path)}")
221+
222+
def show_menu(self):
223+
menu = QMenu(self)
224+
about_action = QAction("Hakkında", self)
225+
about_action.triggered.connect(self.show_about)
226+
menu.addAction(about_action)
227+
menu.exec(self.menu_button.mapToGlobal(QPoint(0, 0)))
228+
229+
def show_about(self):
230+
about_text = (
231+
"\n\n"
232+
" EnCo Dosya Kilitleme Uygulaması\n\n"
233+
" Bu uygulama, dosyalarınızı kriptolayarak güvenli hale getirmenize olanak tanır.\n\n"
234+
" Geliştirici: ALG Yazılım Inc. | www.algyzilim.com | [email protected]\n\n"
235+
" Fatih ÖNDER (CekToR) | wwww.fatihonder.org.tr | [email protected]\n\n"
236+
" EnCo Tüm Hakları Saklıdır. 2024 ALG Software Inc\n\n"
237+
" \n\n"
238+
" ALG Yazılım Pardus'a Göç'ü Destekler."
239+
)
240+
241+
dialog = QDialog(self)
242+
dialog.setWindowTitle("Hakkında")
243+
dialog.resize(520, 250)
244+
label = QLabel(about_text, dialog)
245+
label.setWordWrap(True)
246+
label.setAlignment(Qt.AlignCenter)
247+
dialog.exec()
248+
249+
if __name__ == "__main__":
250+
app = QApplication(sys.argv)
251+
window = FileEncryptionApp()
252+
window.show()
253+
sys.exit(app.exec())
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Metadata-Version: 2.1
2+
Name: enco
3+
Version: 1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Version=1.0
3+
Name=EnCo
4+
Comment=EnCo Application
5+
Exec=python3 /usr/bin/enco.py
6+
Icon=/usr/share/icons/hicolor/48x48/apps/encolo.png
7+
Terminal=false
8+
Type=Application
9+
Categories=Utility
10+
11+
Name[tr_TR]=EnCo
144 Bytes
Binary file not shown.
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: enco
3+
Source: https://github.com/cektor/EnCo
4+
5+
Files: *
6+
Copyright:Fatih ÖNDER (CekToR) 2024 ALG Yazılım Inc.
7+
License: GNU
8+
Loading

debian/encolo.png

33.8 KB
Loading

debian/files

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enco_1.0-1_all.deb python optional
2+
enco_1.0-1_amd64.buildinfo python optional

debian/format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

debian/install

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
enco.py usr/bin/
3+
enco.desktop usr/share/applications/
4+
debian/encolo.png /usr/share/icons/hicolor/48x48/apps/

debian/rules

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/make -f
2+
3+
%:
4+
dh $@ --with python3 --buildsystem=pybuild
5+
6+
override_dh_install:
7+
dh_install
8+
install -d $(DESTDIR)/usr/bin
9+
install -m 755 $(CURDIR)/enco.py $(DESTDIR)/usr/bin/enco.py
10+
install -d $(DESTDIR)/usr/share/applications
11+
install -m 755 $(CURDIR)/debian/enco.desktop $(DESTDIR)/usr/share/applications/enco.desktop
12+
install -d $(DESTDIR)/usr/share/icons/hicolor/48x48/apps
13+
install -m 755 $(CURDIR)/debian/encolo.png $(DESTDIR)/usr/share/icons/hicolor/48x48/apps/encolo.png

0 commit comments

Comments
 (0)