treasurechest/treasurechest/chestcrypto/session/crypto/encrypt.cs

18 lines
439 B
C#
Raw Normal View History

2020-05-30 08:06:08 +00:00
using Sodium;
using chestcrypto.session;
using chestcrypto;
namespace chestcrypto.session.crypto{
2020-05-30 23:00:49 +00:00
internal class SessionCrypto{
2020-05-30 08:06:08 +00:00
2020-05-30 23:00:49 +00:00
public static byte[] encrypt(Session activeSession, byte[] message){
2020-05-30 08:06:08 +00:00
byte[] publicKey = activeSession.getLatestPublicKey();
byte[] privateKey = activeSession.getLatestPrivateKey();
return Curve25519.encrypt(privateKey, publicKey, message);
}
}
}