-
Linux樹林
[Linux] Identify File Types and Encoding with the file Command
Overview In Linux, the file command accurately identifies files by reading their "magic numbers" or header information rather than relying on file extensions. This tool is extremely useful for identifying "mysterious files" without exten... -
Linux樹林
【Linux】fileコマンドでファイルの種類やエンコーディングを判定する
概要 Linuxにおいて、拡張子に頼らずに「ファイルの中身(ヘッダー情報やマジックナンバー)」を読み取って、そのファイルが画像なのか、テキストなのか、実行プログラムなのかを正確に識別するためのコマンドです。 「拡張子がない謎のファイル」や「拡張... -
Linux樹林
[Linux] Create Empty Files and Change Timestamps with the touch Command
Overview The touch command is used to update file timestamps (access time and modification time) to the current time or a specific date. If a file does not exist, the command creates a new "empty file" with a size of 0 bytes. This is com... -
Linux樹林
【Linux】touchコマンドで空ファイル作成・タイムスタンプ変更を行う
概要 touch コマンドは、ファイルのタイムスタンプ(アクセス時刻や更新時刻)を現在時刻または指定した日時に更新するためのコマンドです。 ファイルが存在しない場合は、サイズ0の「空ファイル」を新規作成する用途でも頻繁に使用されます。 動作テスト... -
Linux樹林
[Linux] Securely Destroy and Delete Files with the shred Command
Overview The standard rm command only removes the link to a file in the system. The actual data remains on the disk. The shred command overwrites the file area with random data multiple times. This makes it extremely difficult to recover... -
Linux樹林
【Linux】shredコマンドでファイルを完全に破壊・削除する
概要 rm コマンドによる通常のファイル削除は、システム上の管理情報(リンク)を解除するだけで、ディスク上の実際のデータは残ったままになります。 shred コマンドは、ファイル領域に対してランダムなデータを複数回上書きすることで、磁気レベルでの復... -
Linux樹林
[Linux] A Complete Guide to Deleting Files and Directories with the rm Command
Overview The rm (remove) command is the standard utility for deleting files and directories that are no longer needed in a Linux system. Unlike the trash can feature in graphical user interfaces (GUI), data deleted with the rm command ca... -
Linux樹林
【Linux】rmコマンドによるファイル・ディレクトリ削除の完全ガイド
概要 Linuxシステムにおいて、不要になったファイルやディレクトリを削除するための標準的なコマンドです。 GUIのゴミ箱機能とは異なり、rmコマンドで削除されたデータは標準機能では復元できないため、実行には慎重な操作が求められます。 サーバー管理に... -
Linux樹林
[Linux] Safely Removing Empty Directories with the rmdir Command
Overview rmdir (remove directory) is a command specifically designed to delete empty directories. If you attempt to delete a directory that still contains files, the command will encounter an error and stop. This eliminates the risk of a... -
Linux樹林
【Linux】rmdirコマンドで空のディレクトリを安全に削除する
概要 rmdir(remove directory)は、空のディレクトリを削除するためのコマンドです。 ファイルが含まれているディレクトリを削除しようとするとエラーが発生して停止するため、誤って重要なファイルを消してしまうリスクがありません。「中身が空であるこ... -
C#樹林
[C#] How to Write Values to Excel Cells Using NPOI
Overview This implementation uses the open-source library "NPOI" to set values in specific cells of an Excel sheet. We use a wrapper class to simplify the NPOI-specific process—creating a row first, then allocating a cell within it—allow... -
C#樹林
【C#】NPOIを使ってExcelのセルに値を書き込む
概要 OSSライブラリ「NPOI」を使用し、作成したExcelシートの特定のセルに値を設定する実装です。 行(Row)を作成してから、その中にセル(Cell)を確保して値を書き込むというNPOI特有の手順をラッパークラスで簡略化し、ループ処理などで効率的にデータ... -
C#樹林
[C#] How to Create New Excel Files Using NPOI
Overview This implementation uses the open-source library "NPOI" to create new .xlsx Excel files in environments where Microsoft Excel is not installed. By creating a wrapper class called MyExcelBook, we hide the complexity of NPOI and a... -
C#樹林
【C#】NPOIを使用してExcelファイルを新規作成する
概要 OSSのライブラリである「NPOI」を使用して、Microsoft Excelがインストールされていない環境でも .xlsx 形式のExcelファイルを新規作成する実装です。 NPOIの複雑な処理を隠蔽するラッパークラス MyExcelBook を作成し、直感的にブック作成、シート追... -
C#樹林
[C#] How to Verify Digital Signatures Using RSA Public Keys
Overview This implementation verifies that data has not been tampered with (integrity) and that it was sent by the correct sender (authenticity) by using the received data, the digital signature, and the sender's public key. In modern .N... -
C#樹林
【C#】RSA公開鍵を使用したデジタル署名の検証
概要 受信したデータとデジタル署名、そして送信者の公開鍵を使用して、データが改ざんされていないこと(完全性)と、正しい送信者から送られたこと(真正性)を検証する実装です。 .NETのモダンな実装では、古い RSAPKCS1SignatureDeformatter クラスで... -
C#樹林
[C#]How to Generate Digital Signatures Using RSA and SHA256
Overview This is an implementation to create a digital signature for arbitrary data using an RSA private key. By attaching a digital signature, you can guarantee the authenticity (proving the sender's identity) and integrity (confirming ... -
C#樹林
【C#】RSAとSHA256によるデジタル署名の生成
概要 RSA秘密鍵を使用して、任意のデータに対するデジタル署名(電子署名)を作成する実装です。 デジタル署名を付与することで、データの送信者が本人であること(真正性)と、データが途中で改ざんされていないこと(完全性)を保証できます。 .NETの現... -
C#樹林
[C#] How to Verify Data Integrity Using Hash Values
Overview This implementation verifies whether data has been tampered with or corrupted during communication or storage. By comparing the hash value (digest) calculated from the original data with the hash value of the target data, you ca... -
C#樹林
【C#】ハッシュ値を用いたデータの整合性検証
概要 データが通信や保存の過程で改ざん・破損していないかを検証する実装です。 元のデータから算出されたハッシュ値(ダイジェスト)と、検証対象データのハッシュ値を比較することで、1ビットでも差異があれば不正とみなす厳密なチェックを行います。 ... -
C#樹林
[C#] How to Calculate Data Hash Values Using SHA256
Overview This implementation generates a fixed-length hash value (message digest) from any string or data using the SHA256 algorithm. Hash values are used for detecting data tampering or verifying data identity. A key characteristic is t... -
C#樹林
【C#】SHA256を使用してデータのハッシュ値を計算する
概要 任意の文字列やデータから、SHA256アルゴリズムを使用して固定長のハッシュ値(メッセージダイジェスト)を生成する実装です。 ハッシュ値はデータの改ざん検知や同一性確認に利用され、元のデータが1ビットでも異なれば全く異なる値が出力される特性... -
C#樹林
[C#] How to Read PKCS#1 Format RSA Private Key Files and Decrypt Data
Overview This implementation reads a PKCS#1 format PEM file starting with -----BEGIN RSA PRIVATE KEY----- and uses the private key to decrypt encrypted data. By using the ImportRSAPrivateKey method added in .NET Core 3.0, you can restore... -
C#樹林
【C#】PKCS#1形式のRSA秘密鍵ファイルを読み込んで復号する
概要 「-----BEGIN RSA PRIVATE KEY-----」で始まるPKCS#1形式のPEMファイルを読み込み、その秘密鍵を使用して暗号化データを復号する実装です。 .NET Core 3.0以降で追加された ImportRSAPrivateKey メソッドを使用し、テキスト処理で抽出したバイナリデ... -
C#樹林
[C#]How to Read PKCS#1 Format RSA Public Key Files and Encrypt Data
Overview This implementation demonstrates how to read a PKCS#1 format PEM file starting with "-----BEGIN RSA PUBLIC KEY-----" and use that public key to encrypt data. By using the ImportRSAPublicKey method added in .NET Core 3.0, you can... -
C#樹林
【C#】PKCS#1形式のRSA公開鍵ファイルを読み込んで暗号化する
概要 「-----BEGIN RSA PUBLIC KEY-----」で始まるPKCS#1形式のPEMファイルを読み込み、その公開鍵を使用してデータを暗号化する実装です。 .NET Core 3.0以降で追加された ImportRSAPublicKey メソッドを使用し、Base64デコードされたバイナリデータ(DER... -
C#樹林
[C#]How to Decrypt Data Using RSA Private Keys
Overview This implementation restores data encrypted via the RSA method to its original text using a corresponding private key in XML format. It utilizes the version-independent RSA abstract class in .NET and specifies high-security padd... -
C#樹林
【C#】RSA秘密鍵を使用した暗号化データの復号
概要 RSA暗号化方式で暗号化されたデータを、対となる秘密鍵(XML形式)を使用して元のテキストに戻す(復号する)実装です。 .NETのバージョンに依存しない抽象クラス RSA を使用し、セキュリティ強度の高いパディング方式を指定して安全にデータを復号し... -
C#樹林
[C#]How to Encrypt Data Using RSA Public Keys
Overview This implementation uses a public key in XML format to encrypt sensitive text data. In modern .NET environments, it is recommended to use the factory methods of the abstract RSA class instead of RSACryptoServiceProvider and expl... -
C#樹林
【C#】RSA公開鍵を使用したデータの暗号化
概要 XML形式の公開鍵を使用して、機密性の高いテキストデータを暗号化する実装です。 最新の.NET環境では、RSACryptoServiceProviderではなく抽象クラスRSAのファクトリメソッドを使用し、よりセキュアなパディングモード(OAEP)を明示的に指定する方法...