Skip to content

Commit

Permalink
- Relocating script files
Browse files Browse the repository at this point in the history
- Upgrading Go version
- Changing module name
- Removing import alias
  • Loading branch information
leonardomoralopez89 committed Mar 27, 2024
1 parent b2eaac3 commit 6311028
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions crypto_aes.go → aes/crypto_aes.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package AtlasInsideAES
package aes

import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/sha1"
b64 "encoding/base64"
"encoding/base64"
"golang.org/x/crypto/pbkdf2"
)

Expand Down Expand Up @@ -38,12 +38,12 @@ func Encrypt(src string, key string) (string, error) {
content = pkcs5Padding(content, blkEncrypt.BlockSize())
encrypted := make([]byte, len(content))
ecb.CryptBlocks(encrypted, content)
base64 := b64.StdEncoding.EncodeToString(encrypted)
return base64, nil
b64 := base64.StdEncoding.EncodeToString(encrypted)
return b64, nil
}

func Decrypt(crypt string, key string) (string, error) {
encryptedData, _ := b64.StdEncoding.DecodeString(crypt)
encryptedData, _ := base64.StdEncoding.DecodeString(crypt)
if len(crypt) == 0 {
return "", &InvalidPassphraseError{"Invalid crypto"}
}
Expand Down
2 changes: 1 addition & 1 deletion errors.go → aes/errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package AtlasInsideAES
package aes

type InvalidPassphraseError struct {
Msg string
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/AtlasInsideCorp/AtlasInsideAES
module github.com/InsecureWeb/cryptoutil

go 1.19
go 1.22.0

require golang.org/x/crypto v0.21.0

0 comments on commit 6311028

Please sign in to comment.