Skip to content

Commit

Permalink
add license header
Browse files Browse the repository at this point in the history
  • Loading branch information
wuriyanto48 committed Aug 29, 2023
1 parent 83a9f5f commit e7d8cfb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions crypsi.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
The MIT License (MIT)
Copyright (c) 2023 The TelkomDev Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#ifndef CRYPSI_H
#define CRYPSI_H

Expand Down
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int main(int argc, char** argv) {
unsigned char* dst;
int dst_len;

if(crypsi_aes_192_cbc_encrypt(key_192, plain_data, strlen(plain_data), &dst, &dst_len) != 0) {
if(crypsi_aes_128_gcm_encrypt(key_128, plain_data, strlen(plain_data), &dst, &dst_len) != 0) {
printf("encrypt with aes error\n");
return -1;
}
Expand All @@ -79,7 +79,7 @@ int main(int argc, char** argv) {
unsigned char* dst_decrypt;
int dst_decrypt_len;

if(crypsi_aes_192_cbc_decrypt(key_192, "6417737cf9e0a929a6b12d3d79d4ecad0186609f62adb46fef73900400ff5c6b", strlen("6417737cf9e0a929a6b12d3d79d4ecad0186609f62adb46fef73900400ff5c6b"), &dst_decrypt, &dst_decrypt_len) != 0) {
if(crypsi_aes_128_gcm_decrypt(key_128, "28f23b5b307e0fdd2003dd0afc5ac9d26632437ff543e9e4947ff69f385e16541724f06baa830fdb", strlen("28f23b5b307e0fdd2003dd0afc5ac9d26632437ff543e9e4947ff69f385e16541724f06baa830fdb"), &dst_decrypt, &dst_decrypt_len) != 0) {
printf("decrypt with aes error\n");
return -1;
}
Expand Down

0 comments on commit e7d8cfb

Please sign in to comment.