Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/ Production Grade Technical Solutions | Data Encryption and Public Cloud Expert Wed, 08 Apr 2026 21:55:05 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://www.anujvarma.com/wp-content/uploads/anujtech.png Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/ 32 32 Practical, low-nausea protocol for GLP-1 type drugs https://www.anujvarma.com/practical-low-nausea-protocol-for-glp-1-type-drugs/ https://www.anujvarma.com/practical-low-nausea-protocol-for-glp-1-type-drugs/#respond Wed, 08 Apr 2026 21:55:05 +0000 https://www.anujvarma.com/?p=9845 practical, real-world “low-nausea protocol” for starting GLP-1 drugs like Ozempic or Mounjaro—especially helpful if you also deal with acid reflux or take meds like Omeprazole or Famotidine. 🧭 Phase 1: […]

The post Practical, low-nausea protocol for GLP-1 type drugs appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
practical, real-world “low-nausea protocol” for starting GLP-1 drugs like Ozempic or Mounjaro—especially helpful if you also deal with acid reflux or take meds like Omeprazole or Famotidine.


🧭 Phase 1: First 2–4 Weeks (Adaptation Phase)

🎯 Goal: Minimize nausea + stabilize digestion

1. Timing your meds

  • Take your GLP-1 injection:
    • Evening before a lighter day (e.g., Friday night)
    • Why: you “sleep through” peak side effects
  • Acid meds:
    • PPIs → 30–60 min before breakfast
    • H2 blockers → before dinner or bedtime

🍽 2. Meal structure (this is the biggest lever)

Eat like this:

  • 4–5 small meals instead of 2–3 large ones
  • Stop eating at ~70% full

Best foods early on:

  • Lean protein (chicken, fish, eggs)
  • Simple carbs (rice, toast, oatmeal)
  • Yogurt, soups, smoothies

Avoid initially:

  • Fried / fatty foods ❌
  • Spicy foods ❌
  • Large portions ❌
  • Alcohol ❌

👉 Fat + large meals = #1 nausea trigger on GLP-1s


💧 3. Hydration strategy

  • Sip water throughout the day (not chugging)
  • Add electrolytes if needed
  • Ginger tea or peppermint tea can help nausea

🧠 4. Eating behavior tweaks

  • Eat slowly
  • Chew thoroughly
  • Stay upright for 30–60 minutes after meals

👉 This directly helps both:

  • GLP-1 side effects
  • Acid reflux

⚖ Phase 2: Weeks 4–8 (Dose Escalation)

🎯 Goal: Maintain tolerance as dose increases

  • Expect temporary return of nausea after each dose bump
  • Repeat Phase 1 habits during each increase

Add-ons if needed:

  • Light walking after meals (10–15 min)
  • Smaller dinners (big dinners = reflux trigger)

🛠 “Rescue Plan” for Bad Days

If nausea or reflux spikes:

✔ Do:

  • Switch to liquid/light foods for 24 hours:
    • Broth, yogurt, smoothies
  • Use ginger (capsules or tea)
  • Reduce meal size further

✔ Consider (doctor-approved):

  • Temporary use of anti-nausea meds
  • Adjust timing of acid meds

⚠ Special note for reflux sufferers

GLP-1 drugs slow stomach emptying → this can:

  • Increase pressure + reflux
  • OR reduce reflux (less overeating)

👉 To tilt in your favor:

  • Avoid lying down after meals
  • Keep dinners small
  • Elevate head slightly when sleeping

📊 Simple Daily Template

Morning

  • Take Omeprazole
  • Light breakfast (protein + carb)

Midday

  • Small lunch
  • Hydration + walk

Afternoon

  • Snack (protein-focused)

Evening

  • Light dinner (low fat)
  • Optional Famotidine if prescribed

Weekly

  • GLP-1 injection at night

🧾 Bottom line

  • The key isn’t the drug—it’s how you eat while on it
  • Think:

    “Small, slow, low-fat, upright”

That combination dramatically reduces:

  • Nausea
  • Acid reflux
  • Drop-off rates

The post Practical, low-nausea protocol for GLP-1 type drugs appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/practical-low-nausea-protocol-for-glp-1-type-drugs/feed/ 0
Is Ethereum Deflationary? https://www.anujvarma.com/is-ethereum-deflationary/ https://www.anujvarma.com/is-ethereum-deflationary/#comments Mon, 16 Feb 2026 14:35:14 +0000 https://www.anujvarma.com/?p=9837   Ethereum Staking vs Bitcoin Halving Model 1. Is Ethereum Staking Inflationary Long Term? Post-Merge, Ethereum operates under a Proof-of-Stake model. New ETH is issued to validators who stake capital […]

The post Is Ethereum Deflationary? appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
 

Ethereum Staking vs Bitcoin Halving Model

1. Is Ethereum Staking Inflationary Long Term?

Post-Merge, Ethereum operates under a Proof-of-Stake model.
New ETH is issued to validators who stake capital to secure the network.

A. New ETH Issuance

  • Issued to validators as staking rewards
  • Issuance rate adjusts based on total ETH staked
  • Current gross issuance: ~0.5%–0.7% annually

B. Fee Burning (EIP-1559)

  • Base transaction fees are permanently burned
  • Higher network activity → more ETH burned

Net Supply Outcome

Network Activity Net Supply Effect
Low activity Mildly inflationary
Moderate activity Near neutral
High activity Deflationary

Ethereum’s long-term supply is activity-dependent.


2. Comparison to Bitcoin’s Halving Model

Bitcoin Monetary Structure

  • Fixed maximum supply: 21 million
  • Block rewards halve approximately every 4 years
  • Issuance is time-based and deterministic
  • Eventually reaches zero new issuance

Ethereum Monetary Structure

  • No fixed supply cap
  • Issuance varies based on staking participation
  • Transaction fees are burned
  • Net supply depends on network demand

Core Differences

Feature Ethereum Bitcoin
Supply Cap No fixed cap 21M hard cap
Issuance Driver Staking participation Time-based halving
Fee Handling Fees burned Fees paid to miners
Deflationary Potential Yes, activity-dependent Disinflationary only
Monetary Policy Adaptive Fixed

Summary

Bitcoin: Digital gold model

  • Absolute scarcity
  • Predictable issuance
  • Monetary rigidity

Ethereum: Productive digital asset model

  • Capital-secured network
  • Supply reacts to economic usage
  • Monetary flexibility

Conclusion

Bitcoin provides predictable, capped scarcity.
Ethereum provides adaptive, activity-based monetary dynamics.

The post Is Ethereum Deflationary? appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/is-ethereum-deflationary/feed/ 1
Saving on coinbase sells and trades https://www.anujvarma.com/saving-on-coinbase-sells-and-trades/ https://www.anujvarma.com/saving-on-coinbase-sells-and-trades/#respond Thu, 05 Feb 2026 06:12:21 +0000 https://www.anujvarma.com/?p=9832   In Brief – sign up for Premium and Cancel it after your sale: Coinbase Premium charges $299 / month. With PREMIUM, you pay ZERO transaction fees. The transaction  fees […]

The post Saving on coinbase sells and trades appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
 

In Brief – sign up for Premium and Cancel it after your sale:

Coinbase Premium charges $299 / month. With PREMIUM, you pay ZERO transaction fees. The transaction  fees are 1.5% – which, may exceed your $299 sign up amount. See the example below – if you are selling $100k of crypto, you would be paying $1500 in just transaction fees. While you can just sign up for Premium – pay $299 – and get the entire $1500 waived.

You will still be paying a SPREAD fee (buy / sell spread), but this is closer to .5%.

Coinbase BTC Sell Fee Estimate ( example $100,000 Trade )

Below is an estimate of what it would cost to sell
$100,000 worth of BTC
on the regular Coinbase platform
(not Coinbase Advanced / Pro).


💸 1) Explicit Coinbase Transaction Fee

For a standard “Sell” order on Coinbase (simple trade interface):

  • Base / trading fee:
    Approximately 1.49% for trades over $200.

Estimated cost on $100,000:
$1,490

This is the visible Coinbase trading fee. It can vary slightly based on
payment method, account status, or promotions (e.g., Coinbase One).

📊 2) Approximate Spread Fee

Coinbase does not itemize the spread as a separate fee.
Instead, it is embedded in the execution price you receive.

For a highly liquid asset like BTC, the typical spread is:

  • ~0.5% under normal market conditions

Estimated spread cost on $100,000:
$500

During periods of high volatility or low liquidity,
the effective spread can widen (sometimes approaching or exceeding 1%).

🧾 3) Total Estimated Cost

Cost Component Approximate Amount
Coinbase Transaction Fee (~1.49%) $1,490
Spread (~0.5%) $500
Total Estimated Cost $1,990

Estimated total cost:
~2% of the transaction value.


🔁 Lower-Fee Alternative: Coinbase Advanced

If you execute the same $100,000 BTC sale using
Coinbase Advanced (order book):

  • No flat 1.49% retail fee
  • Maker/taker fees typically ~0.10%–0.20%
  • Limit orders can significantly reduce or eliminate spread

Potential total cost:
Often under $500 on a $100,000 trade,
depending on execution.


🧠 Key Notes

  • On the regular Coinbase app, spread is hidden in the quoted price.
  • Fees vary by region, account type, and market conditions.
  • Coinbase One may waive trading fees, but the spread still applies.

 

 

The post Saving on coinbase sells and trades appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/saving-on-coinbase-sells-and-trades/feed/ 0
Mass Shootings (4 or more injured/killed) per state per capita https://www.anujvarma.com/mass-shootings-4-or-more-injured-killed-per-state-per-capita/ https://www.anujvarma.com/mass-shootings-4-or-more-injured-killed-per-state-per-capita/#respond Wed, 17 Dec 2025 05:59:17 +0000 https://www.anujvarma.com/?p=9827     Mass Shooting Rates by State (2014–2022) Mass shootings are defined as incidents where 4 or more people were shot (injured or killed), excluding the shooter. Data is from […]

The post Mass Shootings (4 or more injured/killed) per state per capita appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
 

 

Mass Shooting Rates by State (2014–2022)

Mass shootings are defined as incidents where 4 or more people were shot (injured or killed), excluding the shooter. Data is from the Gun Violence Archive and JAMA Network Open, calculated per 1 million people over the period 2014–2022.

Mass Shootings and Per-Capita Rates by State

State Mass Shootings Rate per 1M People
Alabama 103 2.32
Alaska 5 0.76
Arizona 45 0.71
Arkansas 44 1.63
California 367 1.04
Colorado 60 1.18
Connecticut 38 0.87
Delaware 19 2.18
Hawaii 0 0.00
Idaho 2 0.13
Illinois 414 3.61
Indiana 93 1.68
Iowa 8 0.31
Kansas 9 0.26
Louisiana 179 4.28
Maine 3 0.25
Maryland 120 2.20
Massachusetts 34 0.55
Michigan 129 1.43
Minnesota 49 0.97
Mississippi 26 2.91
Missouri 126 2.29
Montana 4 0.42
Nebraska 15 0.86
New Hampshire 1 0.08
New Jersey 68 0.95
New Mexico 30 1.42
New York 135 0.69
North Carolina 136 1.26
North Dakota 0 0.00
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island 0 0.00
South Carolina
South Dakota
Tennessee 124 2.03
Texas 270 1.05
Utah 6 0.21
Vermont 1 0.18
Virginia 97 1.27
Washington 45 0.67
West Virginia 5 0.31
Wisconsin 53 1.01
Wyoming 1 0.19
District of Columbia 187 10.49

Data source: Gun Violence Archive; JAMA Network Open. Mass shootings per 1 million population, 2014–2022.

Color-Coded Map of Mass Shooting Rates by State

US Mass Shooting Rates Map 2014-2022

The map shows per-capita mass shooting rates by state, with green indicating the lowest rates (0 per million) and red indicating the highest rates (~4+ per million). Darker green states like Hawaii and North Dakota have the lowest rates, while redder states like Louisiana, Illinois, and D.C. have the highest rates.

 

The post Mass Shootings (4 or more injured/killed) per state per capita appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/mass-shootings-4-or-more-injured-killed-per-state-per-capita/feed/ 0
ISO/IEC 27001 vs. NIST SP 800-171 https://www.anujvarma.com/iso-iec-27001-vs-nist-sp-800-171/ https://www.anujvarma.com/iso-iec-27001-vs-nist-sp-800-171/#respond Wed, 17 Dec 2025 05:38:17 +0000 https://www.anujvarma.com/?p=9825 ISO/IEC 27001 vs NIST SP 800-171 ISO/IEC 27001 vs NIST SP 800-171 Executive Summary ISO/IEC 27001 and NIST SP 800-171 serve different but complementary purposes. ISO/IEC 27001 focuses on enterprise-wide […]

The post ISO/IEC 27001 vs. NIST SP 800-171 appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>




ISO/IEC 27001 vs NIST SP 800-171


ISO/IEC 27001 vs NIST SP 800-171

Executive Summary
ISO/IEC 27001 and NIST SP 800-171 serve different but complementary purposes.
ISO/IEC 27001 focuses on enterprise-wide information security governance,
while NIST SP 800-171 defines prescriptive security requirements for protecting
U.S. government Controlled Unclassified Information (CUI).

High-Level Comparison

Dimension ISO/IEC 27001 NIST SP 800-171
Primary Purpose Enterprise-wide information security management Protection of Controlled Unclassified Information (CUI)
Nature International, certifiable standard U.S. government compliance standard
Scope Organization-wide Systems handling CUI
Governance Depth Very strong Moderate
Technical Prescriptiveness Moderate (risk-based) High (requirement-based)
Certification Yes (third-party audit) No (self-attestation / assessments)
Compliance Driver Customers, regulators, board assurance Federal contracts (DFARS, CMMC)
Primary Audience Executives, risk leaders, auditors Federal contractors, security teams

ISO/IEC 27001 Overview

What It Is

ISO/IEC 27001 is an international standard for establishing, implementing,
operating, monitoring, and continually improving an
Information Security Management System (ISMS).

Core Focus Areas

  • Risk management and risk treatment
  • Policy and control governance
  • Defined ownership and accountability
  • Continuous improvement using the PDCA cycle

Strengths

  • Strong board and executive credibility
  • Globally recognized and regulator-friendly
  • Flexible and technology-agnostic
  • Maps well to SOC 2, HIPAA, GDPR, and NIST frameworks

Limitations

  • Not prescriptive at the technical implementation level
  • Requires supplementary standards for detailed control execution

NIST SP 800-171 Overview

What It Is

NIST SP 800-171 defines mandatory security requirements for protecting
Controlled Unclassified Information (CUI) in
non-federal systems and organizations.

Where It Applies

  • Defense Industrial Base (DIB)
  • Federal contractors and subcontractors
  • Organizations subject to DFARS and CMMC

Structure

  • 14 security control families
  • 110 specific security requirements
  • Derived from NIST SP 800-53

Strengths

  • Clear, testable, and auditable requirements
  • High degree of technical specificity
  • Contractually enforceable

Limitations

  • Narrow scope focused solely on CUI
  • No overarching management system
  • Limited applicability outside U.S. federal contracting

Purpose Alignment

Question ISO/IEC 27001 NIST SP 800-171
Do we manage security risk enterprise-wide? Yes No
Are we compliant with U.S. federal CUI requirements? No Yes
Is this globally recognized? Yes No
Is this technically prescriptive? Partially Yes
Can this satisfy auditors and customers? Yes Yes (within scope)

How They Are Used Together (Best Practice)

ISO/IEC 27001
(Enterprise ISMS & Risk Governance)
    ↓
Risk Treatment Decisions
    ↓
NIST SP 800-171
(CUI-Specific Security Requirements)

In mature organizations, ISO/IEC 27001 provides the governance and risk
management foundation, while NIST SP 800-171 defines the concrete control
requirements for CUI environments.

Consulting Recommendation

  • Use ISO/IEC 27001 to establish enterprise-wide security
    governance, external assurance, and executive accountability.
  • Use NIST SP 800-171 where contractually required to protect
    U.S. government CUI and demonstrate DFARS or CMMC compliance.

ISO/IEC 27001 answers “Are we managing information security correctly as an
organization?”
NIST SP 800-171 answers “Are we meeting our federal CUI obligations?”


The post ISO/IEC 27001 vs. NIST SP 800-171 appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/iso-iec-27001-vs-nist-sp-800-171/feed/ 0
Mass Shootings (including school shootings by State) https://www.anujvarma.com/mass-shootings-including-school-shootings-by-state/ https://www.anujvarma.com/mass-shootings-including-school-shootings-by-state/#respond Sun, 14 Dec 2025 04:59:24 +0000 https://www.anujvarma.com/?p=9823 U.S. Mass Shootings (Hybrid GVA + MJ) — Sample Report Mass Shootings in the United States — Hybrid GVA + Mother Jones This report shows the first years of a […]

The post Mass Shootings (including school shootings by State) appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>




U.S. Mass Shootings (Hybrid GVA + MJ) — Sample Report


Mass Shootings in the United States — Hybrid GVA + Mother Jones

This report shows the first years of a hybrid dataset combining:

  • Mother Jones (MJ) public mass shootings with 4+ killed
  • Gun Violence Archive (GVA) mass shootings with 4+ shot (inclusive)
  • School shootings marked with

Sample State × Year Incident Table (1995–2025)

Year State MJ Count GVA Count School Shooting?
1995 NY 1
1995 MA 1
1998 PA 0
1998 MI 0
1999 CO 1 ★ Columbine HS
2018 FL 1 323+ ★ Parkland
2019 TX 1 434+
2020 Various 0 615+
2021 Various 0 690+
2022 TX 1 695+ ★ Uvalde
2023 CA 0 600+
2024 IL 0 586+
2025* RI 0 397+

*2025 data through Nov. 30 (GVA national totals). :contentReference[oaicite:2]{index=2}

National Trend: Mass Shootings (GVA Inclusive Definition)

2018 2019 2020 2021 2022 2023 2024 2025

323 434 615 690 695 600 586 397*

*Note: Trend uses GVA totals of mass shootings where 4+ people were shot.* :contentReference[oaicite:3]{index=3}

U.S. Map — Mass Shooting Density by State (Demonstration)

This placeholder static image represents relative densities based on known aggregated data (e.g., Statista notes California has highest total since 1982). :contentReference[oaicite:4]{index=4}

State Mass Shooting Map

Replace this with dynamic shading once full raw data is loaded into your system.


The post Mass Shootings (including school shootings by State) appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/mass-shootings-including-school-shootings-by-state/feed/ 0
Gun Violence – Increase regardless of presidency https://www.anujvarma.com/gun-violence-increase-regardless-of-presidency/ https://www.anujvarma.com/gun-violence-increase-regardless-of-presidency/#respond Sun, 14 Dec 2025 04:49:52 +0000 https://www.anujvarma.com/?p=9821 School Shootings Analysis by Presidency School Shootings Analysis Across the Last Six Presidencies This analysis uses three datasets: K–12 School Shooting Database (K–12 SSDB), Gun Violence Archive (GVA), and Everytown, […]

The post Gun Violence – Increase regardless of presidency appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>




School Shootings Analysis by Presidency


School Shootings Analysis Across the Last Six Presidencies

This analysis uses three datasets: K–12 School Shooting Database (K–12 SSDB), Gun Violence Archive (GVA), and Everytown, combined to show trends, legislative actions, and correlations with federal gun policy.

1. Dataset Scope

Dataset Coverage Definition of “School Shooting”
K–12 SSDB 1970–present Any gunfire on K–12 property (includes after-hours, suicides, accidental discharges)
Gun Violence Archive (GVA) 2013–present Any gun incident on school grounds, broader inclusion
Everytown ~2013–present Gunfire during school hours or events; harm-focused

K–12 SSDB is best for long-term presidential analysis; GVA & Everytown are best for recent years.

2. K–12 SSDB — Incidents by Presidency

Presidency Years Incidents Average / Year
George H. W. Bush 1989–1993 ~180 ~45
Bill Clinton 1993–2001 ~400 ~50
George W. Bush 2001–2009 ~430 ~54
Barack Obama 2009–2017 ~500 ~62
Donald Trump 2017–2021 ~330 ~82
Joe Biden 2021–2024* ~430 ~143

*Biden term partial (through latest complete reporting year)

3. Gun Violence Archive (2013–present)

Presidency Years Incidents Average / Year
Obama (late) 2013–2016 ~160 ~40
Trump 2017–2020 ~280 ~70
Biden 2021–2024* ~400 ~130

4. Everytown — Gunfire on School Grounds

Presidency Years Incidents Average / Year
Obama (late) 2013–2016 ~120 ~30
Trump 2017–2020 ~220 ~55
Biden 2021–2024* ~310 ~100

5. Federal Gun Legislation Overlay

Presidency Federal Action Year
Clinton Brady Act 1993
Clinton Assault Weapons Ban (AWB) 1994
George W. Bush NICS Improvement Amendments Act 2008
Obama Executive actions (NICS reporting, ATF guidance) 2013–2016
Trump Bump-stock ban (regulatory) 2018
Biden Bipartisan Safer Communities Act (BSCA) 2022

6. Correlation Analysis

Law Dataset Agreement Observed Effect
1994 AWB Mixed No sustained drop in incidents; possible reduction in lethality (contested)
2008 NIAA Weak Structural improvement; no immediate incident decline
2018 Bump-stock rule None No impact on school shootings (weapon mismatch)
2022 BSCA None (yet) Incidents continued upward post-passage

7. Observations Across Datasets

  • All datasets show an upward trend in school shootings since ~2018.
  • Federal legislation does not correlate with immediate, visible national declines.
  • State-level laws and local interventions explain more variance in incidents than federal policy alone.

8. Executive-Level Takeaway

Across six presidencies and three independent datasets, school shootings increase irrespective of party control. Federal gun legislation correlates weakly with incident counts and more plausibly with system-level factors (background checks, reporting). Short-term changes align more closely with state laws, social conditions, and post-2018 structural shifts than with presidential policy alone.


The post Gun Violence – Increase regardless of presidency appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/gun-violence-increase-regardless-of-presidency/feed/ 0
AES ciphertext length close to plaintext length – leakage https://www.anujvarma.com/aes-ciphertext-length-close-to-plaintext-length-leakage/ https://www.anujvarma.com/aes-ciphertext-length-close-to-plaintext-length-leakage/#respond Wed, 03 Dec 2025 04:04:27 +0000 https://www.anujvarma.com/?p=9815 AES Ciphertext Length Leakage Does AES Ciphertext Length Leak Information? 1️⃣ What Can Be Leaked Even though AES encryption is strong, some metadata can still be inferred from ciphertext: Length […]

The post AES ciphertext length close to plaintext length – leakage appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>




AES Ciphertext Length Leakage


Does AES Ciphertext Length Leak Information?

1️⃣ What Can Be Leaked

Even though AES encryption is strong, some metadata can still be inferred from ciphertext:

  • Length of the plaintext:
    For example, if a hacker sees a 128-byte ciphertext, they know the plaintext was roughly 128 bytes (or slightly less if padding was used).
    This can give clues about the type of data (e.g., a 16-byte message might be a password or ID).
  • Patterns in block modes without randomness:
    ECB mode is particularly vulnerable: identical plaintext blocks produce identical ciphertext blocks, revealing repeating patterns.
    CBC/CTR/GCM modes mitigate this by using IVs or counters to randomize encryption.

2️⃣ How Cryptography Mitigates This

Even though ciphertext length is observable, attackers generally cannot decrypt without the key. Strategies to reduce leakage include:

  • Random padding:
    Add extra random bytes beyond block padding to make messages appear uniform in length.
  • Authenticated encryption modes (GCM, CCM):
    Include random IVs or nonces for each encryption → ciphertext is randomized even for identical plaintext.
  • Message encapsulation:
    In protocols like TLS or S/MIME, ciphertext is wrapped in frames of fixed or variable size to hide exact lengths.
  • Traffic analysis countermeasures:
    Padding can be added at the protocol level to prevent attackers from guessing content size (common in VPNs, messaging apps).

3️⃣ Key Takeaways

  • AES itself is secure — knowing ciphertext length does not allow decryption.
  • Length leakage is a minor information leak.
  • Using secure modes with IVs/nonces and optional padding mitigates this risk.
  • For maximum security (e.g., hiding message lengths), consider padding all messages to a uniform length.


The post AES ciphertext length close to plaintext length – leakage appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/aes-ciphertext-length-close-to-plaintext-length-leakage/feed/ 0
AES 256 Ciphertext Length versus Input String length https://www.anujvarma.com/aes-256-ciphertext-length-versus-input-string-length/ https://www.anujvarma.com/aes-256-ciphertext-length-versus-input-string-length/#respond Wed, 03 Dec 2025 04:01:39 +0000 https://www.anujvarma.com/?p=9813 AES Ciphertext Length Explanation AES Ciphertext Length Explained 1️⃣ AES Block Size AES always operates on 128-bit blocks (16 bytes). The key size (128/192/256 bits) does not affect the block […]

The post AES 256 Ciphertext Length versus Input String length appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>




AES Ciphertext Length Explanation


AES Ciphertext Length Explained

1⃣ AES Block Size

AES always operates on 128-bit blocks (16 bytes). The key size (128/192/256 bits) does not affect the block size.
AES encrypts data in multiples of 16 bytes.

2⃣ Padding

If your plaintext is not a multiple of 16 bytes, AES must pad it before encryption.

  • PKCS#7 padding is common
  • If plaintext = 20 bytes → pad with 12 bytes → total = 32 bytes
  • If plaintext = 32 bytes → add 16 bytes padding → total = 48 bytes

So the ciphertext length is usually ≥ plaintext length, rounded up to the next 16-byte block.

3⃣ Modes of Operation

Mode Ciphertext length vs plaintext Notes
ECB / CBC Multiple of 16 bytes (padding applied) Deterministic / requires IV for CBC
CTR / GCM Same length as plaintext Stream cipher mode, no padding needed
CFB / OFB Same length as plaintext Operates like a stream cipher

Note: CBC and ECB require padding → ciphertext may be longer. CTR, GCM, CFB, OFB → ciphertext = plaintext length (excluding authentication tag in GCM).

4⃣ Example

  • Plaintext: Hello world! (12 bytes)
  • AES-256-CBC → padded to 16 bytes → ciphertext = 16 bytes
  • AES-256-CTR → ciphertext = 12 bytes

Note: For AES-GCM, an authentication tag (usually 16 bytes) is appended to the ciphertext.

✅ Summary

  • AES block size = 16 bytes, ciphertext = multiples of 16 bytes if using block modes with padding.
  • Stream modes (CTR/GCM) → ciphertext ≈ plaintext length (tag aside).


The post AES 256 Ciphertext Length versus Input String length appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/aes-256-ciphertext-length-versus-input-string-length/feed/ 0
Running Sum of Randomly Generated Numbers https://www.anujvarma.com/running-sum-of-randomly-generated-numbers/ https://www.anujvarma.com/running-sum-of-randomly-generated-numbers/#respond Thu, 27 Nov 2025 15:17:43 +0000 http://www.anujvarma.com/?p=3152 Integers from 1 to N are randomly generated . Each integer has an equal probability of being selected and unlimited repetition is permitted. A running sum is maintained. Given any […]

The post Running Sum of Randomly Generated Numbers appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>

Integers from 1 to N are randomly generated . Each integer has an equal probability of being selected and unlimited repetition is permitted. A running sum is maintained.

Given any integer k, such that 1 <= k <= n , what is the probability that a sum of EXACTLY n will be reached?

Probabilities of Partial Sums

Let P(n,k) be the probability that a run using the integer n will produce a sum of exactly k.



 

Probability of Hitting Exactly n

Integers from 1 to k are repeatedly drawn uniformly at random (with replacement) and a running sum is maintained. We ask:
for a fixed target integer n, what is the probability that some partial sum equals exactly n?

1. Interpretation

At each step you add an independent uniform draw from the set \(\{1,2,\dots,k\}\) (each with probability \(1/k\)). If, at any time, the running sum equals \(n\) we say the target is hit. If the running sum exceeds \(n\) that trial has failed to hit exactly \(n\).

2. Recurrence (computational)

Let \(P(n)\) denote the probability that the process will reach exactly \(n\) starting from sum 0. Then

\[ P(0)=1,\qquad P(n)=\frac{1}{k}\sum_{i=1}^{k} P(n-i)\quad\text{for }n\ge1,\]
with the convention \(P(m)=0\) for \(m<0\).

This recurrence follows by conditioning on the first draw: if the first draw is \(i\) (probability \(1/k\)), we then need to reach \(n-i\) from there.

3. Generating function

Define \(G(x)=\sum_{n\ge0} P(n)x^n\). The recurrence implies

\[ G(x)=\frac{1}{1-\dfrac{x}{k}\cdot\dfrac{1-x^{k}}{1-x}}. \]

Equivalently,

\[ G(x)=\frac{1-x}{1-x-\dfrac{x}{k}(1-x^{k})}. \]

4. Combinatorial (closed-form finite sum)

Let \(a(n,m)\) be the number of ordered sequences (compositions) of length \(m\) whose parts lie in \(\{1,\dots,k\}\) and that sum to \(n\). Then

\[ P(n)=\sum_{m=\lceil n/k\rceil}^{n} a(n,m)\left(\frac{1}{k}\right)^m. \]

The integer counts \(a(n,m)\) have an inclusion–exclusion formula (bounded-compositions / stars-and-bars with upper bounds):

\[ a(n,m)=\sum_{j=0}^{\left\lfloor\dfrac{n-m}{k}\right\rfloor} (-1)^j \binom{m}{j} \binom{n-kj-1}{m-1}. \]

Combining gives the finite-sum closed form

\[ P(n)=\sum_{m=\lceil n/k\rceil}^{n} \left(\frac{1}{k}\right)^m \sum_{j=0}^{\left\lfloor\dfrac{n-m}{k}\right\rfloor} (-1)^j \binom{m}{j} \binom{n-kj-1}{m-1}. \]

5. Special checks

  • k=1: then the only draw is 1, so \(P(n)=1\) for every \(n\).
  • Small k: for k=2 the recurrence becomes \(P(n)=(P(n-1)+P(n-2))/2\) with \(P(0)=1,P(-1)=0\), etc.

6. Small numerical example (corrected)

Take \(k=6\) (uniform on \(\{1,\dots,6\}\)) and compute \(P(n)\) up to \(n=10\) using the recurrence \(P(n)=\tfrac{1}{6}\sum_{i=1}^{6}P(n-i)\) with \(P(0)=1\) and \(P(m)=0\) for \(m<0\).

Exact rational values and decimals

P(0) = 1 = 1.0000000000

The post Running Sum of Randomly Generated Numbers appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/running-sum-of-randomly-generated-numbers/feed/ 0