Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Embedded Acceleration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Vipin Thomas
Embedded Acceleration
Commits
6bf3ef76
Commit
6bf3ef76
authored
3 years ago
by
Vipin Thomas
Browse files
Options
Downloads
Patches
Plain Diff
Update pixel.cpp, Source_program.c files
parent
ba280ff1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source_program.c
+98
-0
98 additions, 0 deletions
Source_program.c
pixel.cpp
+1
-1
1 addition, 1 deletion
pixel.cpp
with
99 additions
and
1 deletion
Source_program.c
0 → 100644
+
98
−
0
View file @
6bf3ef76
#include
<math.h>
#include
<stdio.h>
static
int
count_streams
=
0
;
static
long
long
charIn
=
0
;
int
arr
[
8
]
=
{
255
,
254
,
253
,
252
,
251
,
250
,
249
,
248
};
long
long
convert
(
int
n
);
long
long
toAscii
(
char
c
);
int
convertBinInt
(
long
long
n
);
void
stegno
(
char
c
);
char
stegnoDcrypt
(
int
arr
[]);
void
main
()
{
stegno
(
'c'
);
printf
(
"%c
\n
"
,
stegnoDcrypt
(
arr
));
}
void
stegno
(
char
c
){
charIn
=
toAscii
(
c
);
int
addNum
;
for
(
int
i
=
0
;
i
<
8
;
i
++
){
addNum
=
charIn
%
10
;
charIn
=
(
int
)
charIn
/
10
;
arr
[
i
]
=
convertBinInt
((
convert
(
arr
[
i
])
/
10
)
*
10
+
addNum
);
printf
(
"%d
\n
"
,
arr
[
i
]);
}
}
char
stegnoDcrypt
(
int
arr
[]){
int
decrpyt
=
0
;
long
long
asciiNum
=
0
;
int
asciiVal
=
0
;
//int arr[8]={255,254,253,252,251,250,249,248};
for
(
int
i
=
7
;
i
>=
0
;
i
--
){
decrpyt
=
convert
(
arr
[
i
])
%
10
;
printf
(
"%d
\n
"
,
decrpyt
);
asciiNum
=
asciiNum
*
10
+
decrpyt
;
// ascii=> ascii*10 + lsb
}
asciiVal
=
convertBinInt
(
asciiNum
);
printf
(
"%d
\n
"
,
asciiVal
);
return
(
char
)
asciiVal
;
}
long
long
convert
(
int
n
)
{
long
long
bin
=
0
;
int
rem
,
i
=
1
,
step
=
1
;
while
(
n
!=
0
)
{
rem
=
n
%
2
;
n
/=
2
;
bin
+=
rem
*
i
;
i
*=
10
;
}
return
bin
;
}
int
convertBinInt
(
long
long
n
)
{
int
dec
=
0
,
i
=
0
,
rem
;
while
(
n
!=
0
)
{
rem
=
n
%
10
;
n
/=
10
;
dec
+=
rem
*
pow
(
2
,
i
);
++
i
;
}
return
dec
;
}
long
long
toAscii
(
char
c
)
{
int
n
=
(
int
)
c
;
long
long
bin
=
convert
(
n
);
return
bin
;
}
This diff is collapsed.
Click to expand it.
pixel.cpp
+
1
−
1
View file @
6bf3ef76
...
...
@@ -6,7 +6,7 @@ using namespace std;
typedef
ap_axis
<
32
,
0
,
0
,
0
>
pkt_t
;
static
int
count_streams
=
0
;
static
long
long
charIn
=
1
;
static
long
long
charIn
=
0
;
long
long
convert
(
int
n
)
long
long
toAscii
(
chr
number
);
...
...
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