用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/zapek/Xeres --skill crypto命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
ArchUnit architecture rules enforced in Xeres including common module rules (logging, utility classes), app module rules (no field injection, RsService naming), and UI module rules (WindowController naming).
DTO and mapper patterns for Xeres using Java records, canonical constructors with validation, and static mapper utility classes.
Flyway SQL migration patterns for Xeres including naming conventions, H2 database patterns, enum types, foreign keys, and best practices.
正在显示 SKILL.md
| name | crypto |
| description | Cryptography patterns for Xeres including PGP operations, key generation, and hash functions with best practices. |
Xeres uses JCE/JCA and BouncyCastle for cryptographic operations. Always use the registered providers.
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.
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"
);
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);
}
SecureRandomUtils class for all random operationsCryptographic 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).