-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecrypt.sh
More file actions
executable file
·49 lines (44 loc) · 1.48 KB
/
decrypt.sh
File metadata and controls
executable file
·49 lines (44 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash -
#===============================================================================
#
# FILE: decrypt.sh
#
# USAGE: ./decrypt.sh
# DESCRIPTION: décrypte les fichiers d'un répertoire de man symétrique
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Dr. Fritz Mehner (fgm), mehner@fh-swf.de
# COMPANY: FH Südwestfalen, Iserlohn
# CREATED: 23/11/2011 14:19:10 CET
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
echo "déchiffrage des fichiers doc"
for fichier in *.doc do
RESULTAT="$(basename ${fichier} .gpg)"
gpg --output $(basename ${fichier} .gpg) --symmetric --decrypt
gpg --output essai.doc2 --decrypt essai.doc.pgp
done
echo "déchiffrage fichiers pdf"
for fichier in *.pdf do
RESULTAT="$(basename ${fichier} .gpg)"
echo "hellodolly" | gpg --output $(basename ${fichier}.gpg) --symetric --decrypt
done
gpg --output essai.doc2 --decrypt essai.doc.pgp
#!/usr/bin/env python
import pexpect
import os
# pour chaque fichier doc faire
# le sous env est un fichier python
from path import path
d = path('/home/corentin/projets/cv')
for f in d.files('*.pgp'):
#rep="/home/corentin/projets/cv"
#dirList=os.listdir(rep)
#for fname in dirList:
# construie la chaine et appeler pexpect.spawn
chaine = "gpg --output " + fname
child = pexpect.spawn('gpg --output $(