Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
play-unfair
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marcela Ribeiro de Oliveira
play-unfair
Commits
93c0f748
Commit
93c0f748
authored
7 years ago
by
Marcela Ribeiro de Oliveira
Browse files
Options
Downloads
Patches
Plain Diff
fix warns e organizando
parent
9dd164cc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
playunfair.cpp
+5
-6
5 additions, 6 deletions
playunfair.cpp
scripts/dict.sh
+0
-0
0 additions, 0 deletions
scripts/dict.sh
scripts/utftoascii.sh
+0
-0
0 additions, 0 deletions
scripts/utftoascii.sh
with
5 additions
and
6 deletions
playunfair.cpp
+
5
−
6
View file @
93c0f748
...
...
@@ -8,12 +8,11 @@ int main(int argc, char *argv[]){
return
0
;
}
std
::
fstream
input
,
output
,
dict
;
char
*
inputName
,
*
outputName
,
*
dictName
;
char
*
inputName
,
*
dictName
;
std
::
string
aux
=
""
,
key
,
crip
;
std
::
ostringstream
text
,
keys
;
inputName
=
argv
[
1
];
outputName
=
argv
[
2
];
dictName
=
argv
[
3
];
input
.
open
(
inputName
,
std
::
ifstream
::
in
);
...
...
@@ -39,14 +38,13 @@ int main(int argc, char *argv[]){
key
=
keys
.
str
();
crip
=
playfair
(
crip
,
key
,
DECRYPT
);
if
(
filter
(
crip
)
==
ACCEPTED
){
std
::
cout
<<
crip
<<
std
::
endl
;
std
::
cout
<<
key
<<
std
::
endl
;
std
::
cout
<<
key
<<
": "
<<
crip
<<
std
::
endl
;
}
keys
.
str
(
""
);
keys
.
clear
();
}
std
::
cout
<<
crip
<<
std
::
endl
;
//
std::cout << crip << std::endl;
return
0
;
}
...
...
@@ -65,7 +63,8 @@ int filter(std::string text){
//
// )
// { elimina texto: muda pra proxima chave}
int
i
,
j
,
rej
=
REJECTED
;
size_t
i
,
j
;
int
rej
=
REJECTED
;
for
(
int
i
=
0
;
i
<
4
;
++
i
){
if
(
text
[
i
]
==
'a'
||
text
[
i
]
==
'e'
||
text
[
i
]
==
'i'
||
text
[
i
]
==
'o'
||
text
[
i
]
==
'u'
){
...
...
This diff is collapsed.
Click to expand it.
dict.sh
→
scripts/
dict.sh
+
0
−
0
View file @
93c0f748
File moved
This diff is collapsed.
Click to expand it.
utftoascii.sh
→
scripts/
utftoascii.sh
+
0
−
0
View file @
93c0f748
File moved
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment