crypto
БесплатноБез исполняемых скриптовНе проверенCryptography patterns for Xeres including PGP operations, key generation, and hash functions with best practices.
от zapek★ 224 звезды на GitHubОб этом скилле
Cryptography Patterns for Xeres
JCE/JCA and BouncyCastle Usage
Xeres uses JCE/JCA and BouncyCastle for cryptographic operations. Always use the registered providers.
Common Patterns
OpenPGP Operations
import org.bouncycastle.openpgp.*;
class Foobar
{
PGPSecretKeyRingCollection secretKeys = getSecretKey();
PGPPublicKeyRingCollection publicKeys = getPublicKey();
// Encrypt
var encryptorBuilder = new JcePGPDataEncryptorBuilder(SymmetricKeyAlgorithmTags.AES_128)
.setWithIntegrityPacket(true) // Required to guarantee integrity
.setSecureRandom(SecureRandomUtils.getGenerator());
var encryptedDataGenerator = new PGPEncryptedDataGenerator(encryptorBuilder);
encryptedDataGenerator.addMethod(new
JcePublicKeyKeyEncryptionMethodGenerator(publicKeys));
// Decrypt
PGPPrivateKey privateKey = secretKeys.getSecretKey(keyId)
.extractPrivateKey(new JcePBESecretKeyDecryptorBuilder()
.setProvider("BC")
.build(passphrase.toCharArray()));
}
See app/src/main/java/io/xeres/app/crypto/pgp/PGP.java for real-world usage.
Key Generation
import org.bouncycastle.bcpg.*;
import org.bouncycastle.openpgp.*;
var keyRingGenerator = new PGPKeyRingGenerator(
V3PGPSignature.POSITIVE_CERTIFICATION,
new PGPSignatureSubpacketGenerator(),
algorithm,
encryptionKey,
creationTime,
"User ID",
symmetricKeyEncryption,
hashedGen,
unhashedGen,
new SecureRandom(),
"BC"
);
Hash Functions
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.security.MessageDigest;
class Foobar
{
static
{
Security.addProvider(new BouncyCastleProvider());
}
MessageDigest digest = MessageDigest.getInstance("SHA-256", "BC");
byte[] hash = digest.digest(data);
}
Best Practices
- Use the
SecureRandomUtilsclass for all random operations - Prefer JCA/JCE, otherwise use BouncyCastle
- Use constant-time comparisons for secrets
- Clear sensitive data from memory when done
- Use appropriate key sizes (RSA 2048+)
Identifier Classes
Cryptographic identifiers implement Identifier:
public class GxsId implements Identifier, Comparable<GxsId>
{
public static final int LENGTH = 16;
}
Existing identifiers are in common/src/main/java/io/xeres/common/id/ (e.g. GxsId, Sha1Sum, ProfileFingerprint).
Установить crypto в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл crypto?
Cryptography patterns for Xeres including PGP operations, key generation, and hash functions with best practices.
Как установить скилл crypto?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл crypto запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic