What is the difference between security parameter and $b$-bit security? In a previous question, I read

... for $b$-bit security meaning $O(2^b)$ work for an attacker to break the system...

While in Katz's Introduction to modern Cryptography, I read:

The key-generation algorithm $\text{Gen}$ takes as input $1^n$ (i.e., the security parameter written in unary) and outputs a key $k$&quot;.

What is the difference between security parameter and $b$-bit security?
Edit: Can I have an example for the McEliece cryptosystem?
What is the difference between security parameter $1^n$ and $b$-bit security?

There's not one, but two:

A security parameter $1^n$ does not precisely specify how the attacker work grows with $n$. Depending on author and context, that can be: unspecified; faster than any polynomial in $n$ (common in asymmetric cryptography); exponential in $n$ (common in theoretical symmetric cryptography); or roughly¹ as $2^n$ (common in applied symmetric cryptography).
By contrast, &quot;$b$-bit security&quot; specifies that the work for attack grows roughly¹ as $2^b$, as it can in symmetric cryptography for attacks aiming at recovery of a $b$-bit key for an ideal cipher. The distinction is paramount in RSA, where $n$ most often is the bit size of the modulus, and $n=2048$ is believed to yield $b\approx112$.

When we consider algorithms running in time at most polynomial to the size of their input, as is customary in theoretical work: passing $1^n$ (meaning a bitstring consisting of $n$ bits at one) as input implies that the run time is polynomial in $n$, when passing $n$ would allow the run time to be a polynomial in $\log(n)$. Usually the former is desired in cryptography.
Whereas &quot;$b$-bit security&quot; says nothing about the run time.



¹ For some definition of roughly. Many, including me, often state that the expected attacker work is $O(2^b)$,. That's improper because that upper-bounds said work. We should at least  write $\Omega(2^b)$ or $\Theta(2^b)$; see this. I corrected that (minor and common) issue in my answer to the &quot;previous question&quot; mentioned.